[][src]Trait deadpool::Manager

pub trait Manager<T, E> {
    fn create<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<T, E>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn recycle<'life0, 'async_trait>(
        &'life0 self,
        obj: T
    ) -> Pin<Box<dyn Future<Output = Result<T, E>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }

This trait is used to create new objects or recycle existing ones.

Required methods

fn create<'life0, 'async_trait>(
    &'life0 self
) -> Pin<Box<dyn Future<Output = Result<T, E>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

Create a new instance of T

fn recycle<'life0, 'async_trait>(
    &'life0 self,
    obj: T
) -> Pin<Box<dyn Future<Output = Result<T, E>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

Try to recycle an instance of T, create a new instance of T if that fails or return an error if that fails, too.

Loading content...

Implementors

Loading content...