Trait fpool::Pool[][src]

pub trait Pool {
    type Item;
    type ConstructionError;
    fn get(
        &mut self
    ) -> Result<&mut ItemHandle<Self::Item>, Self::ConstructionError>; }

An object which returns re-used items. Pools hold on to a constructor so they can recreate elements that are invalid (marked by user).

Associated Types

Required Methods

Items are re-used unless invalid, in which case they are re-constructed. If the construction fails, then the error is returned. Do not hold on to the ItemHandle reference, as it may be returned by a subsequent call on get().

Implementors