Struct ra_ap_rustc_arena::TypedArena
source · pub struct TypedArena<T> { /* private fields */ }
Expand description
An arena that can hold objects of only one type.
Implementations§
source§impl<T> TypedArena<T>
impl<T> TypedArena<T>
sourcepub fn alloc(&self, object: T) -> &mut T
pub fn alloc(&self, object: T) -> &mut T
Allocates an object in the TypedArena
, returning a reference to it.
sourcepub fn alloc_from_iter<I: IntoIterator<Item = T>>(&self, iter: I) -> &mut [T]
pub fn alloc_from_iter<I: IntoIterator<Item = T>>(&self, iter: I) -> &mut [T]
Allocates the elements of this iterator into a contiguous slice in the TypedArena
.
Note: for reasons of reentrancy and panic safety we collect into a SmallVec<[_; 8]>
before
storing the elements in the arena.
Trait Implementations§
source§impl<T> Default for TypedArena<T>
impl<T> Default for TypedArena<T>
source§fn default() -> TypedArena<T>
fn default() -> TypedArena<T>
Creates a new TypedArena
.
source§impl<T> Drop for TypedArena<T>
impl<T> Drop for TypedArena<T>
impl<T: Send> Send for TypedArena<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for TypedArena<T>
impl<T> !Sync for TypedArena<T>
impl<T> Unpin for TypedArena<T>where
T: Unpin,
impl<T> UnwindSafe for TypedArena<T>where
T: UnwindSafe + RefUnwindSafe,
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