pub struct ListArena<T> { /* private fields */ }Expand description
Compact typed arena index and list storage utilities. A simple append-only store for variable-length typed child lists.
Implementations§
Source§impl<T> ListArena<T>
impl<T> ListArena<T>
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates an empty list arena with capacity for capacity items.
Sourcepub fn push_many<I>(&mut self, items: I) -> IdRange<T>where
I: IntoIterator<Item = T>,
pub fn push_many<I>(&mut self, items: I) -> IdRange<T>where
I: IntoIterator<Item = T>,
Appends a variable-length list and returns the typed range for it.
Sourcepub fn as_mut_slice(&mut self) -> &mut [T]
pub fn as_mut_slice(&mut self) -> &mut [T]
Returns all arena items as a mutable slice.
Sourcepub fn get_mut(&mut self, range: IdRange<T>) -> &mut [T]
pub fn get_mut(&mut self, range: IdRange<T>) -> &mut [T]
Returns the mutable slice covered by range.
Sourcepub fn into_boxed_slice(self) -> Box<[T]>
pub fn into_boxed_slice(self) -> Box<[T]>
Consumes the arena and returns the packed items as a boxed slice.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ListArena<T>
impl<T> RefUnwindSafe for ListArena<T>where
T: RefUnwindSafe,
impl<T> Send for ListArena<T>where
T: Send,
impl<T> Sync for ListArena<T>where
T: Sync,
impl<T> Unpin for ListArena<T>where
T: Unpin,
impl<T> UnsafeUnpin for ListArena<T>
impl<T> UnwindSafe for ListArena<T>where
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