[−][src]Struct salva3d::object::ContiguousArena
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
.
Methods
impl<Idx, T> ContiguousArena<Idx, T>
[src]
pub fn new() -> Self
[src]
Creates a new empty arena.
pub fn len(&self) -> usize
[src]
The number of objects on this arena.
pub fn get(&self, handle: Idx) -> Option<&T> where
Idx: Into<ContiguousArenaIndex>,
[src]
Idx: Into<ContiguousArenaIndex>,
Gets a reference to the object identified by handle
.
pub fn get_mut(&mut self, handle: Idx) -> Option<&mut T> where
Idx: Into<ContiguousArenaIndex>,
[src]
Idx: Into<ContiguousArenaIndex>,
Gets a mutable reference to the object identified by handle
.
pub fn values(&self) -> Iter<T>
[src]
Gets references to all the objects on this set.
pub fn values_mut(&mut self) -> IterMut<T>
[src]
Gets mutable references to all the objects on this set.
pub fn iter<'a>(&'a self) -> impl Iterator<Item = (Idx, &'a T)> + 'a where
Idx: From<ContiguousArenaIndex>,
[src]
Idx: From<ContiguousArenaIndex>,
Iter through all the objects as well as their handle.
pub fn as_slice(&self) -> &[T]
[src]
Retrieves the set of objects as a slice.
pub fn as_mut_slice(&mut self) -> &mut [T]
[src]
Retrieves the set of objects as a mutable slice.
pub fn insert(&mut self, object: T) -> Idx where
Idx: From<ContiguousArenaIndex>,
[src]
Idx: From<ContiguousArenaIndex>,
Insert an object into this set.
pub fn remove(&mut self, handle: Idx) -> Option<T> where
Idx: Into<ContiguousArenaIndex>,
[src]
Idx: Into<ContiguousArenaIndex>,
Remove an object from this set.
Trait Implementations
impl<Idx, T> AsMut<[T]> for ContiguousArena<Idx, T>
[src]
impl<Idx, T> AsRef<[T]> for ContiguousArena<Idx, T>
[src]
impl<Idx: Clone, T: Clone> Clone for ContiguousArena<Idx, T>
[src]
fn clone(&self) -> ContiguousArena<Idx, T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<Idx: Into<ContiguousArenaIndex>, T> Index<Idx> for ContiguousArena<Idx, T>
[src]
impl<Idx: Into<ContiguousArenaIndex>, T> IndexMut<Idx> for ContiguousArena<Idx, T>
[src]
Auto Trait Implementations
impl<Idx, T> RefUnwindSafe for ContiguousArena<Idx, T> where
Idx: RefUnwindSafe,
T: RefUnwindSafe,
Idx: RefUnwindSafe,
T: RefUnwindSafe,
impl<Idx, T> Send for ContiguousArena<Idx, T> where
Idx: Send,
T: Send,
Idx: Send,
T: Send,
impl<Idx, T> Sync for ContiguousArena<Idx, T> where
Idx: Sync,
T: Sync,
Idx: Sync,
T: Sync,
impl<Idx, T> Unpin for ContiguousArena<Idx, T> where
Idx: Unpin,
T: Unpin,
Idx: Unpin,
T: Unpin,
impl<Idx, T> UnwindSafe for ContiguousArena<Idx, T> where
Idx: UnwindSafe,
T: UnwindSafe,
Idx: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,