Struct mgf::Pool[][src]

pub struct Pool<T> { /* fields omitted */ }

Growable array type that allows items to be removed and inserted without changing the indices of other entries.

Methods

impl<T> Pool<T>
[src]

Create an empty Pool.

Create an empty Pool large enough to fix cap items.

Determines if the Pool is empty.

Returns the number of occupied slots in the pool.

Removes all entries from the pool.

Push a new item to the pool. Attempts to use spots left empty from removed items before performing a heap allocation.

Marks an index as empty and adds it to the free list, allowing the spot to be reclaimed later.

Returns the next available id for reuse if one exists.

Returns a reference to an object at the given index and None if it is unoccupied.

Returns a mutable reference to an object at the given index and None if it is unoccupied.

Trait Implementations

impl<T> Index<usize> for Pool<T>
[src]

The returned type after indexing.

Performs the indexing (container[index]) operation.

impl<T> IndexMut<usize> for Pool<T>
[src]

Performs the mutable indexing (container[index]) operation.

impl<T> Clone for Pool<T> where
    T: Clone
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<L, T> From<L> for Pool<T> where
    L: IntoIterator<Item = T>, 
[src]

Performs the conversion.

impl<'a, T> IntoIterator for &'a Pool<T>
[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> IntoIterator for &'a mut Pool<T>
[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

Auto Trait Implementations

impl<T> Send for Pool<T> where
    T: Send

impl<T> Sync for Pool<T> where
    T: Sync