pub struct StableArena<Id: Identifier, T> { /* private fields */ }Expand description
Stable logical IDs over compact, dense physical payload storage.
Implementations§
Source§impl<Id: Identifier, T> StableArena<Id, T>
impl<Id: Identifier, T> StableArena<Id, T>
Sourcepub fn issued_len(&self) -> usize
pub fn issued_len(&self) -> usize
Returns the number of logical IDs issued, including removed IDs.
Sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Returns the payload capacity reserved by the dense value vector.
Sourcepub fn structural_bytes(&self) -> usize
pub fn structural_bytes(&self) -> usize
Returns bytes reserved by the arena’s three structural vectors.
Allocations owned by T itself are deliberately excluded.
Sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Releases structural capacity retained beyond the current live/issued lengths.
Identifiers, liveness, and dense physical order are unchanged; only allocator capacity is returned. Intended for explicit end-of-mutation boundaries — shrinking after every removal would reallocate on the next growth.
Sourcepub fn get(&self, id: Id) -> Option<Identified<Id, &T>>
pub fn get(&self, id: Id) -> Option<Identified<Id, &T>>
Returns the live payload identified by id, if any.
Sourcepub fn get_mut(&mut self, id: Id) -> Option<Identified<Id, &mut T>>
pub fn get_mut(&mut self, id: Id) -> Option<Identified<Id, &mut T>>
Returns the live payload identified by id mutably, if any.
Trait Implementations§
Source§impl<Id: Clone + Identifier, T: Clone> Clone for StableArena<Id, T>
impl<Id: Clone + Identifier, T: Clone> Clone for StableArena<Id, T>
Source§fn clone(&self) -> StableArena<Id, T>
fn clone(&self) -> StableArena<Id, T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<Id: Identifier, T: Debug> Debug for StableArena<Id, T>
impl<Id: Identifier, T: Debug> Debug for StableArena<Id, T>
Source§impl<Id: Identifier, T> Default for StableArena<Id, T>
impl<Id: Identifier, T> Default for StableArena<Id, T>
Source§impl<'de, Id: Identifier, T: Deserialize<'de>> Deserialize<'de> for StableArena<Id, T>
impl<'de, Id: Identifier, T: Deserialize<'de>> Deserialize<'de> for StableArena<Id, T>
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<Id: Eq + Identifier, T: Eq> Eq for StableArena<Id, T>
Source§impl<Id: Identifier, T> FromIterator<T> for StableArena<Id, T>
impl<Id: Identifier, T> FromIterator<T> for StableArena<Id, T>
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl<Id: Identifier, T> Index<Id> for StableArena<Id, T>
impl<Id: Identifier, T> Index<Id> for StableArena<Id, T>
Source§impl<Id: Identifier, T> IndexMut<Id> for StableArena<Id, T>
impl<Id: Identifier, T> IndexMut<Id> for StableArena<Id, T>
Source§impl<'a, Id: Identifier, T> IntoIterator for &'a StableArena<Id, T>
impl<'a, Id: Identifier, T> IntoIterator for &'a StableArena<Id, T>
Source§impl<'a, Id: Identifier, T> IntoIterator for &'a mut StableArena<Id, T>
impl<'a, Id: Identifier, T> IntoIterator for &'a mut StableArena<Id, T>
Source§impl<Id: Identifier, T> IntoIterator for StableArena<Id, T>
impl<Id: Identifier, T> IntoIterator for StableArena<Id, T>
Source§impl<Id: PartialEq + Identifier, T: PartialEq> PartialEq for StableArena<Id, T>
impl<Id: PartialEq + Identifier, T: PartialEq> PartialEq for StableArena<Id, T>
Source§impl<Id: Identifier, T: Serialize> Serialize for StableArena<Id, T>
impl<Id: Identifier, T: Serialize> Serialize for StableArena<Id, T>
impl<Id: PartialEq + Identifier, T: PartialEq> StructuralPartialEq for StableArena<Id, T>
Auto Trait Implementations§
impl<Id, T> Freeze for StableArena<Id, T>
impl<Id, T> RefUnwindSafe for StableArena<Id, T>
impl<Id, T> Send for StableArena<Id, T>
impl<Id, T> Sync for StableArena<Id, T>
impl<Id, T> Unpin for StableArena<Id, T>
impl<Id, T> UnsafeUnpin for StableArena<Id, T>
impl<Id, T> UnwindSafe for StableArena<Id, T>
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