pub trait Connector: Send + Sync + 'static {
    type Transport: Transport;

    // Required methods
    fn connect<'life0, 'life1, 'async_trait>(
        &'life0 self,
        url: &'life1 Url
    ) -> Pin<Box<dyn Future<Output = Result<Self::Transport, Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn spawn<Fut>(&self, fut: Fut)
       where Fut: Future<Output = ()> + Send + 'static;
}
Expand description

Interface for runtime and tls adapters for the trillium client

See trillium_client for more information on usage.

Required Associated Types§

type Transport: Transport

Required Methods§

fn connect<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 Url ) -> Pin<Box<dyn Future<Output = Result<Self::Transport, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Initiate a connection to the provided url

Async trait signature:

async fn connect(&self, url: &Url) -> std::io::Result<Self::Transport>;

fn spawn<Fut>(&self, fut: Fut)
where Fut: Future<Output = ()> + Send + 'static,

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl Connector for Box<dyn ObjectSafeConnector>

§

type Transport = BoxedTransport

§

fn connect<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 Url ) -> Pin<Box<dyn Future<Output = Result<BoxedTransport, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Box<dyn ObjectSafeConnector>: 'async_trait,

§

fn spawn<Fut>(&self, fut: Fut)
where Fut: Future<Output = ()> + Send + 'static,

§

impl Connector for Arc<dyn ObjectSafeConnector>

§

type Transport = BoxedTransport

§

fn connect<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 Url ) -> Pin<Box<dyn Future<Output = Result<BoxedTransport, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<dyn ObjectSafeConnector>: 'async_trait,

§

fn spawn<Fut>(&self, fut: Fut)
where Fut: Future<Output = ()> + Send + 'static,

Implementors§