[][src]Struct light_arena::Allocator

pub struct Allocator<'a> { /* fields omitted */ }

The allocator provides exclusive access to the memory arena, allowing for allocation of objects in the arena.

Objects allocated by an allocated cannot outlive it, upon destruction of the allocator the memory space it requested will be made available again. Drops of allocated objects are not called, only types which are Sized + Copy can be safely stored.

Methods

impl<'a> Allocator<'a>[src]

pub fn alloc_slice<T: Sized + Copy>(&self, len: usize) -> &mut [T][src]

Get a dynamically sized slice of data from the allocator. The contents of the slice will be unintialized.

pub fn alloc<T: Sized + Copy>(&self, object: T) -> &mut T[src]

Trait Implementations

impl<'a> Drop for Allocator<'a>[src]

fn drop(&mut self)[src]

Upon dropping the allocator we mark all the blocks in the arena as empty again, "releasing" our allocations.

Auto Trait Implementations

impl<'a> Send for Allocator<'a>

impl<'a> !Sync for Allocator<'a>

impl<'a> Unpin for Allocator<'a>

impl<'a> !UnwindSafe for Allocator<'a>

impl<'a> !RefUnwindSafe for Allocator<'a>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]