pub struct Arena { /* private fields */ }Implementations§
Source§impl Arena
impl Arena
pub fn new<T: Finalize>(capacity: usize) -> Self
Sourcepub unsafe fn new_raw(
type_hash: TypeHash,
item_layout: Layout,
finalizer: unsafe fn(*mut ()),
capacity: usize,
) -> Self
pub unsafe fn new_raw( type_hash: TypeHash, item_layout: Layout, finalizer: unsafe fn(*mut ()), capacity: usize, ) -> Self
§Safety
pub fn type_hash(&self) -> TypeHash
pub fn item_layout(&self) -> &Layout
pub fn finalizer(&self) -> unsafe fn(*mut ())
pub fn capacity(&self) -> usize
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn contains(&self, index: Index) -> bool
pub fn clear(&mut self)
pub fn insert<T>(&mut self, value: T) -> Result<Index, ArenaError>
pub fn remove(&mut self, index: Index) -> Result<(), ArenaError>
pub fn read<T>( &self, index: Index, ) -> Result<ValueReadAccess<'_, T>, ArenaError>
pub fn write<T>( &self, index: Index, ) -> Result<ValueWriteAccess<'_, T>, ArenaError>
pub fn is<T>(&self, index: Index) -> Result<bool, ArenaError>
pub fn is_raw( &self, index: Index, type_hash: TypeHash, ) -> Result<bool, ArenaError>
pub fn indices(&self) -> impl Iterator<Item = Index> + '_
pub fn iter<'a, T: 'a>(&'a self) -> impl Iterator<Item = ValueReadAccess<'a, T>>
pub fn iter_mut<'a, T: 'a>( &'a self, ) -> impl Iterator<Item = ValueWriteAccess<'a, T>>
Trait Implementations§
Auto Trait Implementations§
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