pub trait ObjectSafeConnector: Send + Sync + 'static {
    // Required methods
    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,
             Self: 'async_trait;
    fn spawn(&self, fut: Pin<Box<dyn Future<Output = ()> + Send>>);

    // Provided methods
    fn boxed(self) -> Box<dyn ObjectSafeConnector>
       where Self: Sized { ... }
    fn arced(self) -> Arc<dyn ObjectSafeConnector>
       where Self: Sized { ... }
}
Expand description

Required Methods§

source

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, Self: 'async_trait,

source

fn spawn(&self, fut: Pin<Box<dyn Future<Output = ()> + Send>>)

Provided Methods§

source

fn boxed(self) -> Box<dyn ObjectSafeConnector>
where Self: Sized,

source

fn arced(self) -> Arc<dyn ObjectSafeConnector>
where Self: Sized,

Trait Implementations§

source§

impl Connector for Box<dyn ObjectSafeConnector>

§

type Transport = BoxedTransport

source§

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,

Initiate a connection to the provided url Read more
source§

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

source§

impl Debug for dyn ObjectSafeConnector

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Implementors§

source§

impl<T> ObjectSafeConnector for T
where T: Connector,