ClientFactory

Trait ClientFactory 

Source
pub trait ClientFactory<K, V> {
    // Required method
    fn make<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 K,
    ) -> Pin<Box<dyn Future<Output = Result<V, MtopError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait used by a client pool for creating new client instances when needed.

Implementations are expected to retain any required configuration for client instances beyond the identifier for an instance (usually a server address).

Required Methods§

Source

fn make<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 K, ) -> Pin<Box<dyn Future<Output = Result<V, MtopError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create a new client instance based on its ID.

Implementors§