pub struct Id {
pub index: usize,
pub generation: u8,
}Expand description
A fixed-size sparse collection that maintains optional values at specified indices.
SparseSlot<T> provides a fixed-capacity container where each slot can either be empty (None)
or contain a value (Some(T)). Once initialized, the capacity cannot be changed. Values can only
be set once in empty slots - attempting to overwrite an existing value will be ignored.
§Type Parameters
T- The type of elements stored in the collection
§Characteristics
- Fixed size - Capacity is determined at creation
- Sparse storage - Slots can be empty or filled
- One-time assignment - Values can only be set once per slot
- Index-based access - Direct access to elements via indices
- Iterator support - Both immutable and mutable iteration over non-empty slots
Fields§
§index: usize§generation: u8Implementations§
Trait Implementations§
Source§impl Ord for Id
impl Ord for Id
Source§impl PartialOrd for Id
impl PartialOrd for Id
impl Copy for Id
impl Eq for Id
impl StructuralPartialEq for Id
Auto Trait Implementations§
impl Freeze for Id
impl RefUnwindSafe for Id
impl Send for Id
impl Sync for Id
impl Unpin for Id
impl UnwindSafe for Id
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more