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]
fn new() -> Self[src]
Create an empty Pool.
fn with_capacity(cap: usize) -> Self[src]
Create an empty Pool large enough to fix cap items.
fn empty(&self) -> bool[src]
Determines if the Pool is empty.
fn len(&self) -> usize[src]
fn push(&mut self, item: T) -> usize[src]
Push a new item to the Pool. Attempts to use spots left empty from removed items before performing a heap allocation.
fn remove(&mut self, i: usize) -> T[src]
Marks an index as empty and adds it to the free list, allowing the spot to be reclaimed later.
fn iter<'a>(
&'a self
) -> FilterMap<Iter<'a, PoolEntry<T>>, fn(_: &PoolEntry<T>) -> Option<&T>>[src]
&'a self
) -> FilterMap<Iter<'a, PoolEntry<T>>, fn(_: &PoolEntry<T>) -> Option<&T>>
fn iter_mut<'a>(
&'a mut self
) -> FilterMap<IterMut<'a, PoolEntry<T>>, fn(_: &mut PoolEntry<T>) -> Option<&mut T>>[src]
&'a mut self
) -> FilterMap<IterMut<'a, PoolEntry<T>>, fn(_: &mut PoolEntry<T>) -> Option<&mut T>>
Trait Implementations
impl<T> Index<usize> for Pool<T>[src]
type Output = T
The returned type after indexing.
fn index(&self, i: usize) -> &T[src]
Performs the indexing (container[index]) operation.
impl<T> IndexMut<usize> for Pool<T>[src]
fn index_mut(&mut self, i: usize) -> &mut T[src]
Performs the mutable indexing (container[index]) operation.
impl<T> Clone for Pool<T> where
T: Clone, [src]
T: Clone,
fn clone(&self) -> Self[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl<'a, T> IntoIterator for &'a Pool<T>[src]
type Item = &'a T
The type of the elements being iterated over.
type IntoIter = FilterMap<Iter<'a, PoolEntry<T>>, fn(_: &PoolEntry<T>) -> Option<&T>>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter[src]
Creates an iterator from a value. Read more