[][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, 'life1, 'async_trait>(
        &'life0 self,
        obj: &'life1 mut T
    ) -> Pin<Box<dyn Future<Output = Result<(), E>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: '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, 'life1, 'async_trait>(
    &'life0 self,
    obj: &'life1 mut T
) -> Pin<Box<dyn Future<Output = Result<(), E>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 

Try to recycle an instance of T returning None` if the object could not be recycled.

Loading content...

Implementors

Loading content...