[][src]Struct fpool::RoundRobinPool

pub struct RoundRobinPool<T, TCError> { /* fields omitted */ }

A Pool that uses round-robin logic to retrieve items in the pool. Can be converted into the items with the into_items() function.

Methods

impl<T, TCError> RoundRobinPool<T, TCError>[src]

pub fn builder<F: 'static + Send + Fn() -> Result<T, TCError>>(
    pool_size: usize,
    constructor: F
) -> Builder<RoundRobinPool<T, TCError>>
[src]

Get the builder for the pool.

pub fn get(&mut self) -> Result<&mut ItemHandle<T>, TCError>[src]

Pass-through call to the Pool trait's get().

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().

pub fn size(&self) -> usize[src]

pub fn into_items(self) -> impl Iterator<Item = T>[src]

pub fn items_iter(&self) -> impl Iterator<Item = &T>[src]

pub fn items_iter_mut(&mut self) -> impl Iterator<Item = &mut T>[src]

Trait Implementations

impl<T, TCError> Pool for RoundRobinPool<T, TCError>[src]

type Item = T

type ConstructionError = TCError

Auto Trait Implementations

impl<T, TCError> !RefUnwindSafe for RoundRobinPool<T, TCError>

impl<T, TCError> Send for RoundRobinPool<T, TCError> where
    T: Send

impl<T, TCError> !Sync for RoundRobinPool<T, TCError>

impl<T, TCError> Unpin for RoundRobinPool<T, TCError> where
    T: Unpin

impl<T, TCError> !UnwindSafe for RoundRobinPool<T, TCError>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.