Struct salva3d::object::ContiguousArena [−][src]
pub struct ContiguousArena<Idx, T> { /* fields omitted */ }
Expand description
This is a Vec
behind a generational arena.
The goal of this structure is to have unique identifiers for elements
stored contiguously on a Vec
.
Implementations
pub fn get_from_contiguous_index(&self, index: usize) -> Option<(&T, Idx)> where
Idx: From<ContiguousArenaIndex>,
pub fn get_from_contiguous_index(&self, index: usize) -> Option<(&T, Idx)> where
Idx: From<ContiguousArenaIndex>,
Get an element from its position on the contiguous array.
Gets a reference to the object identified by handle
.
Gets a mutable reference to the object identified by handle
.
Gets mutable references to all the objects on this set.
Iter through all the objects as well as their handle.
Retrieves the set of objects as a mutable slice.
Insert an object into this set.
Remove an object from this set.
Trait Implementations
Auto Trait Implementations
impl<Idx, T> RefUnwindSafe for ContiguousArena<Idx, T> where
Idx: RefUnwindSafe,
T: RefUnwindSafe,
impl<Idx, T> Send for ContiguousArena<Idx, T> where
Idx: Send,
T: Send,
impl<Idx, T> Sync for ContiguousArena<Idx, T> where
Idx: Sync,
T: Sync,
impl<Idx, T> Unpin for ContiguousArena<Idx, T> where
Idx: Unpin,
T: Unpin,
impl<Idx, T> UnwindSafe for ContiguousArena<Idx, T> where
Idx: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.