[][src]Struct purezen::allocator::FixedSizeAllocator

pub struct FixedSizeAllocator<T: Allocated, N: ArrayLength<Option<T>>> { /* fields omitted */ }

Allocator with a fixed-size buffer for use in no_std environments

Methods

impl<T, N> FixedSizeAllocator<T, N> where
    T: Allocated,
    N: ArrayLength<Option<T>>, 
[src]

pub fn new(label: &'static str) -> Self[src]

Create a new state object, initialized to the default state

pub fn iter_mut(&mut self) -> IterMut<T>[src]

Iterate over the contents of this allocator mutably

Trait Implementations

impl<T, N> Allocator<T> for FixedSizeAllocator<T, N> where
    T: Allocated,
    N: ArrayLength<Option<T>>, 
[src]

Important traits for &'_ mut I
fn allocate<F>(&mut self, f: F) -> &mut T where
    F: Fn(T::Id) -> T, 
[src]

Allocate a slot in the buffer and call the given function to get a value

Panics if there is no space available in the buffer.

fn get(&self, id: T::Id) -> Option<&T>[src]

Get value located at the given slot ID.

fn get_mut(&mut self, id: T::Id) -> Option<&mut T>[src]

Get a mutable reference to an value located at the given slot ID.

impl<T: Debug + Allocated, N: Debug + ArrayLength<Option<T>>> Debug for FixedSizeAllocator<T, N>[src]

impl<T, N> Index<<T as Allocated>::Id> for FixedSizeAllocator<T, N> where
    T: Allocated,
    N: ArrayLength<Option<T>>, 
[src]

type Output = T

The returned type after indexing.

impl<T, N> IndexMut<<T as Allocated>::Id> for FixedSizeAllocator<T, N> where
    T: Allocated,
    N: ArrayLength<Option<T>>, 
[src]

Auto Trait Implementations

impl<T, N> Send for FixedSizeAllocator<T, N> where
    T: Send

impl<T, N> Sync for FixedSizeAllocator<T, N> where
    T: Sync

Blanket Implementations

impl<T> From for T[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

impl<T> Same for T[src]

type Output = T

Should always be Self