pub struct ArenaStore {
pub arena: FrameArena,
/* private fields */
}Expand description
Arena-backed object store. Combines FrameArena with a typed entry list for objects that need to be accessed by index.
Fields§
§arena: FrameArenaThe underlying bump arena (tracks memory pages).
Implementations§
Source§impl ArenaStore
impl ArenaStore
pub fn new() -> Self
Sourcepub fn alloc<T: Any + 'static>(&mut self, value: T) -> usize
pub fn alloc<T: Any + 'static>(&mut self, value: T) -> usize
Allocate a new entry in the arena store.
Sourcepub fn get<T: Any + 'static>(&self, index: usize) -> Option<&T>
pub fn get<T: Any + 'static>(&self, index: usize) -> Option<&T>
Get a reference to the stored value at the given index.
Sourcepub fn live_count(&self) -> usize
pub fn live_count(&self) -> usize
Number of live entries.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ArenaStore
impl !RefUnwindSafe for ArenaStore
impl !Send for ArenaStore
impl !Sync for ArenaStore
impl Unpin for ArenaStore
impl UnsafeUnpin for ArenaStore
impl !UnwindSafe for ArenaStore
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more