[−][src]Struct purezen::allocator::FixedSizeAllocator
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]
T: Allocated,
N: ArrayLength<Option<T>>,
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]
T: Allocated,
N: ArrayLength<Option<T>>,
ⓘImportant traits for &'_ mut Ifn allocate<F>(&mut self, f: F) -> &mut T where
F: Fn(T::Id) -> T,
[src]
ⓘImportant traits for &'_ mut I
F: Fn(T::Id) -> T,
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]
T: Allocated,
N: ArrayLength<Option<T>>,
type Output = T
The returned type after indexing.
ⓘImportant traits for &'_ mut Ifn index(&self, index: T::Id) -> &T
[src]
ⓘImportant traits for &'_ mut I
impl<T, N> IndexMut<<T as Allocated>::Id> for FixedSizeAllocator<T, N> where
T: Allocated,
N: ArrayLength<Option<T>>,
[src]
T: Allocated,
N: ArrayLength<Option<T>>,
Auto Trait Implementations
impl<T, N> Send for FixedSizeAllocator<T, N> where
T: Send,
T: Send,
impl<T, N> Sync for FixedSizeAllocator<T, N> where
T: Sync,
T: Sync,
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
ⓘImportant traits for &'_ mut Ifn borrow_mut(&mut self) -> &mut T
[src]
ⓘImportant traits for &'_ mut I
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same for T
[src]
type Output = T
Should always be Self