Trait trillium_testing::ObjectSafeConnector

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§

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,

Trait Implementations§

§

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,

Initiate a connection to the provided url Read more
§

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

§

impl Debug for dyn ObjectSafeConnector

§

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

Formats the value using the given formatter. Read more

Implementors§

§

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