[−][src]Trait purezen::allocator::Allocator
Indexed memory allocator providing O(1) access to contained values by
a T::Id
type.
Required methods
ⓘImportant traits for &'_ mut Ifn allocate<F>(&mut self, f: F) -> &mut T where
F: Fn(T::Id) -> T,
ⓘ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>
Get an object located at the given slot ID.
fn get_mut(&mut self, id: T::Id) -> Option<&mut T>
Get a mutable reference to an object located at the given slot ID.
Implementors
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.