[−][src]Struct swim_mem::alloc::Slab
Allocator for a hunk of memory partitioned into fixed size memory blocks.
Methods
impl<'a> Slab<'a>
[src]
pub fn new(hunk: Block<'a>, unit: usize) -> Slab<'a>
[src]
Returns a new Slab
that allocates a hunk of memory in unit
-sized blocks.
pub fn size(&self) -> usize
[src]
Returns the total number of bytes in this Slab
.
pub fn block_size(&self) -> usize
[src]
Returns the number of bytes in each memory block of this Slab
.
pub fn block_count(&self) -> usize
[src]
Returns the total number of blocks in this Slab
.
pub fn live(&self) -> usize
[src]
Returns the number of currently allocated memory blocks.
pub fn dead(&self) -> usize
[src]
Returns the number of memory blocks currently available for allocation.
pub fn into_block(self) -> Block<'a>
[src]
Consumes this Slab
and returns its hunk of memory.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,