pub trait IndexedId: Copy {
const COUNT: usize;
// Required methods
unsafe fn from_index_release_unchecked(index: usize) -> Self;
fn to_index(self) -> usize;
}Expand description
A trait for property-id-like types that can be stored compactly in an
IdSet bitfield.
Required Associated Constants§
Required Methods§
Sourceunsafe fn from_index_release_unchecked(index: usize) -> Self
unsafe fn from_index_release_unchecked(index: usize) -> Self
Builds an id from its index in the set. The caller must guarantee that
index < Self::COUNT.
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.