Trait offset_allocator::NodeIndex
source · pub trait NodeIndex: Clone + Copy + Default {
type NonMax: NodeIndexNonMax + TryFrom<Self> + Into<Self>;
const MAX: u32;
// Required methods
fn from_u32(val: u32) -> Self;
fn to_usize(self) -> usize;
}
Expand description
Determines the number of allocations that the allocator supports.
By default, Allocator
and related functions use u32
, which allows for
u32::MAX - 1
allocations. You can, however, use u16
instead, which
causes the allocator to use less memory but limits the number of allocations
within a single allocator to at most 65,534.
Required Associated Types§
sourcetype NonMax: NodeIndexNonMax + TryFrom<Self> + Into<Self>
type NonMax: NodeIndexNonMax + TryFrom<Self> + Into<Self>
The NonMax
version of this type.
This is used extensively to optimize enum
representations.
Required Associated Constants§
Required Methods§
Object Safety§
This trait is not object safe.