ObjectPool

Trait ObjectPool 

Source
pub trait ObjectPool: Send + Sync {
    type Item: Send + Unpin;
    type AcquireFuture: Future<Output = Self::Item> + Send;

    // Required method
    fn acquire(&self) -> Self::AcquireFuture;
}
Expand description

An object pool.

Required Associated Types§

Source

type Item: Send + Unpin

The pooled value.

Source

type AcquireFuture: Future<Output = Self::Item> + Send

Type of future returned by acquire.

Required Methods§

Source

fn acquire(&self) -> Self::AcquireFuture

Acquires an item from the object pool.

Implementors§

Source§

impl<T> ObjectPool for ElasticObjectPool<T>
where T: Poolable + Send + Unpin + 'static,

Source§

type Item = T

Source§

type AcquireFuture = ElasticAcquireFuture<T>

Source§

impl<T> ObjectPool for FixedSizeObjectPool<T>
where T: Poolable + Send + Unpin + 'static,

Source§

type Item = T

Source§

type AcquireFuture = FixedSizeAcquireFuture<T>

Source§

impl<T> ObjectPool for OnDemandObjectPool<T>
where T: Poolable + Send + Unpin + 'static,