Struct slab::Slab [] [src]

pub struct Slab<T, I: Index> { /* fields omitted */ }

A preallocated chunk of memory for storing objects of the same type.

Methods

impl<T, I: Index> Slab<T, I>
[src]

Like insert but for objects that require newly allocated usize in their constructor.

Releases the given slot

Execute a function on the value in the slot and put the result of the function back into the slot. If function returns None, slot is left empty on exit.

Returns Err(()) if slot was empty

This method is very useful for storing state machines inside Slab

Retain only the elements specified by the predicate.

In other words, remove all elements e such that f(&e) returns false. This method operates in place and preserves the order of the retained elements.

Empty the slab, by freeing all entries

Grow the slab, by adding entries_num

Trait Implementations

impl<T, I: Index> Send for Slab<T, I> where
    T: Send
[src]

impl<T, I: Index> Index<I> for Slab<T, I>
[src]

The returned type after indexing

The method for the indexing (container[index]) operation

impl<T, I: Index> IndexMut<I> for Slab<T, I>
[src]

The method for the mutable indexing (container[index]) operation

impl<T, I: Index> Debug for Slab<T, I>
[src]

Formats the value using the given formatter.

impl<'a, T, I: Index> IntoIterator for &'a Slab<T, I>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

impl<'a, T, I: Index> IntoIterator for &'a mut Slab<T, I>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more