Struct fixed_typed_arena::Arena [−][src]
An arena that allocates items of type T
in non-amortized O(1) (constant)
time.
The arena allocates fixed-size chunks of memory, each able to hold up to
ChunkSize
items. ChunkSize
is an unsigned
type-level integer.
All items are allocated on the heap.
Panics
The arena may panic when created or used if
mem::size_of::<T>()
times
ChunkSize::USIZE
is greater than usize::MAX
.
Implementations
impl<T, ChunkSize: Unsigned> Arena<T, ChunkSize>
[src]
pub fn new() -> Self
[src]
Creates a new Arena
.
#[must_use]pub fn alloc(&self, value: T) -> &mut T
[src]
Allocates a new item in the arena and initializes it with value
.
Returns a reference to the allocated item.
Trait Implementations
Auto Trait Implementations
impl<T, ChunkSize = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>> !Send for Arena<T, ChunkSize>
impl<T, ChunkSize = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>> !Sync for Arena<T, ChunkSize>
impl<T, ChunkSize> Unpin for Arena<T, ChunkSize> where
T: Unpin,
T: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,