pub struct Arena<T> { /* private fields */ }Implementations§
Source§impl<T: Clone> Arena<T>
impl<T: Clone> Arena<T>
pub const fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
pub fn into_inner(self) -> Vec<T>
pub fn len(&self) -> usize
pub fn capacity(&self) -> usize
pub fn buffer_len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> impl DoubleEndedIterator<Item = (Handle<T>, &T)> + '_
pub fn drain(&mut self) -> impl Iterator<Item = (Handle<T>, T, Span)> + '_
pub fn iter_mut( &mut self, ) -> impl DoubleEndedIterator<Item = (Handle<T>, &mut T)> + '_
pub fn append(&mut self, value: T, count: usize) -> Handle<T>
pub fn fetch_if<F: Fn(&T) -> bool>(&self, fun: F) -> Option<Handle<T>>
pub fn fetch_if_or_append<F: Fn(&T, &T) -> bool>( &mut self, value: T, count: usize, fun: F, ) -> Handle<T>
pub fn fetch_or_append(&mut self, value: T, count: usize) -> Handle<T>where
T: PartialEq,
pub fn try_get(&self, handle: Handle<T>) -> Result<&T, &'static str>
pub fn get_mut(&mut self, handle: Handle<T>) -> &mut T
pub fn clear(&mut self)
pub fn get_span(&self, handle: Handle<T>) -> Span
pub fn check_contains_handle( &self, handle: Handle<T>, ) -> Result<(), &'static str>
pub fn retain_mut<P>(&mut self, predicate: P)
pub fn free(&mut self, handle: Handle<T>)
pub fn as_slice(&self) -> &[T]
pub fn as_mut_slice(&mut self) -> &mut [T]
pub fn spans(&self) -> &[Span]
pub fn free_spans(&self) -> &[Span]
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Arena<T>
impl<T> RefUnwindSafe for Arena<T>where
T: RefUnwindSafe,
impl<T> Send for Arena<T>where
T: Send,
impl<T> Sync for Arena<T>where
T: Sync,
impl<T> Unpin for Arena<T>where
T: Unpin,
impl<T> UnwindSafe for Arena<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