Struct poison_pool::PoisonPool
[−]
[src]
pub struct PoisonPool<T> { /* fields omitted */ }
A pool that contains elements that can be recycled when they are finished being used.
Methods
impl<T> PoisonPool<T>
[src]
fn new<F: FnMut() -> T>(count: usize, init: F) -> PoisonPool<T>
Creates a new PoisonPool with a given size and where each element is initialized by the init function.
fn get(&self) -> Option<Item<T>>
Returns an unpoisoned item from the pool if possible.
fn get_or(&self, v: T) -> Item<T>
Returns an unpoisoned item from the pool, or a given value, if one is not available.
fn get_or_else<F: FnOnce() -> T>(&self, f: F) -> Item<T>
Returns an unpoisoned item from the pool, or value generated by the function
f
if one is not available
fn unpoison_all(&self)
Removes poison from all the internal items
Trait Implementations
impl<T: Clone> Clone for PoisonPool<T>
[src]
fn clone(&self) -> PoisonPool<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more