Skip to main content

DeboaHttpConnectionPool

Trait DeboaHttpConnectionPool 

Source
pub trait DeboaHttpConnectionPool: Sealed {
    // Required methods
    fn new() -> Self;
    fn connections(&self) -> &HashMap<String, DeboaConnection>;
    fn create_connection<'a, 'life0, 'life1, 'async_trait>(
        &'a mut self,
        url: Arc<Url>,
        protocol: &'life0 HttpVersion,
        client_cert: &'life1 Option<ClientCert>,
    ) -> Pin<Box<dyn Future<Output = Result<&'a mut DeboaConnection>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait that represents the HTTP connection pool.

Required Methods§

Source

fn new() -> Self

Allow create a new connection pool.

§Returns
  • HttpConnectionPool - The new connection pool.
Source

fn connections(&self) -> &HashMap<String, DeboaConnection>

Allow get connections.

§Returns
  • &HashMap<String, DeboaConnection> - The connections.
Source

fn create_connection<'a, 'life0, 'life1, 'async_trait>( &'a mut self, url: Arc<Url>, protocol: &'life0 HttpVersion, client_cert: &'life1 Option<ClientCert>, ) -> Pin<Box<dyn Future<Output = Result<&'a mut DeboaConnection>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Allow create a new connection.

§Arguments
  • url - The url to connect.
  • protocol - The protocol to use.
  • retries - The number of retries.
§Returns
  • Result<&mut DeboaConnection> - The connection or error.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§