pub struct Arena<const SIZE: usize> { /* private fields */ }
Expand description
A fixed size arena that can be used to allocate memory for arbitrary types.
Implementations§
Source§impl<'a, const SIZE: usize> Arena<SIZE>
impl<'a, const SIZE: usize> Arena<SIZE>
Sourcepub fn acquire_init_default<T: Init>(&'a self) -> Option<&'a T>
pub fn acquire_init_default<T: Init>(&'a self) -> Option<&'a T>
acquire a reference to a value of type T that can be initialized with the Init trait, using the default value of the InitArg. This is useful for types that require initialization and the init arg is Default.
Sourcepub fn acquire_init<T: Init>(&'a self, arg: T::InitArg) -> Option<&'a T>
pub fn acquire_init<T: Init>(&'a self, arg: T::InitArg) -> Option<&'a T>
acquire a reference to a value of type T that can be initialized with the Init trait, using a given InitArg. This is useful for types that require initialization.
Sourcepub fn acquire_default<T: Default>(&'a self) -> Option<&'a T>
pub fn acquire_default<T: Default>(&'a self) -> Option<&'a T>
acquire a reference to a value of type T that is initialized with it’s default value. This is useful for types that do not require initialization.
Trait Implementations§
impl<const SIZE: usize> Send for Arena<SIZE>
impl<const SIZE: usize> Sync for Arena<SIZE>
Auto Trait Implementations§
impl<const SIZE: usize> !Freeze for Arena<SIZE>
impl<const SIZE: usize> !RefUnwindSafe for Arena<SIZE>
impl<const SIZE: usize> Unpin for Arena<SIZE>
impl<const SIZE: usize> UnwindSafe for Arena<SIZE>
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