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 Constants§
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 Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.