Struct pool::Pool
[−]
[src]
pub struct Pool<T: Reset> { /* fields omitted */ }
A pool of reusable values
Methods
impl<T: Reset> Pool<T>
[src]
fn with_capacity<F>(count: usize, extra: usize, init: F) -> Pool<T> where
F: Fn() -> T,
F: Fn() -> T,
Creates a new pool that can contain up to capacity
entries as well as
extra
extra bytes. Initializes each entry with the given function.
fn checkout(&mut self) -> Option<Checkout<T>>
Checkout a value from the pool. Returns None
if the pool is currently
at capacity.
The value returned from the pool has not been reset and contains the state that it previously had when it was last released.