Struct ra_ap_rustc_arena::DroplessArena
source · pub struct DroplessArena { /* private fields */ }
Expand description
An arena that can hold objects of multiple different types that impl Copy
and/or satisfy !mem::needs_drop
.
Implementations§
source§impl DroplessArena
impl DroplessArena
pub fn alloc_raw(&self, layout: Layout) -> *mut u8
pub fn alloc<T>(&self, object: T) -> &mut T
sourcepub fn alloc_slice<T>(&self, slice: &[T]) -> &mut [T]where
T: Copy,
pub fn alloc_slice<T>(&self, slice: &[T]) -> &mut [T]where
T: Copy,
Allocates a slice of objects that are copied into the DroplessArena
, returning a mutable
reference to it. Will panic if passed a zero-sized type.
Panics:
- Zero-sized types
- Zero-length slices
sourcepub fn alloc_str(&self, string: &str) -> &str
pub fn alloc_str(&self, string: &str) -> &str
Allocates a string slice that is copied into the DroplessArena
, returning a
reference to it. Will panic if passed an empty string.
Panics:
- Zero-length string
pub fn alloc_from_iter<T, I: IntoIterator<Item = T>>(&self, iter: I) -> &mut [T]
Trait Implementations§
source§impl Default for DroplessArena
impl Default for DroplessArena
source§fn default() -> DroplessArena
fn default() -> DroplessArena
Returns the “default value” for a type. Read more
impl Send for DroplessArena
Auto Trait Implementations§
impl !RefUnwindSafe for DroplessArena
impl !Sync for DroplessArena
impl Unpin for DroplessArena
impl UnwindSafe for DroplessArena
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