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
type Item
type ConstructionError
Required Methods
fn get(
&mut self
) -> Result<&mut ItemHandle<Self::Item>, Self::ConstructionError>
&mut self
) -> Result<&mut ItemHandle<Self::Item>, Self::ConstructionError>
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
impl<T, TCError> Pool for RoundRobinPool<T, TCError> type Item = T; type ConstructionError = TCError;