pub struct Arena<T> { /* private fields */ }Expand description
An append-only arena with typed Handle-based access.
Implementations§
Source§impl<T> Arena<T>
impl<T> Arena<T>
Sourcepub fn next_handle(&self) -> Handle<T>
pub fn next_handle(&self) -> Handle<T>
Returns the handle that will be assigned to the next appended value.
Sourcepub fn try_get(&self, handle: Handle<T>) -> Option<&T>
pub fn try_get(&self, handle: Handle<T>) -> Option<&T>
Returns a reference to the value if the handle is valid.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Arena<T>
impl<T> RefUnwindSafe for Arena<T>where
Vec<T>: RefUnwindSafe,
impl<T> Send for Arena<T>
impl<T> Sync for Arena<T>
impl<T> Unpin for Arena<T>
impl<T> UnsafeUnpin for Arena<T>where
Vec<T>: UnsafeUnpin,
impl<T> UnwindSafe for Arena<T>where
Vec<T>: UnwindSafe,
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