Trait TransportFactory

Source
pub trait TransportFactory: Send + Sync {
    type Conn: FramedConnection;

    // Required methods
    fn connect<'life0, 'life1, 'async_trait>(
        &'life0 self,
        endpoint: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Conn, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn bind<'life0, 'life1, 'async_trait>(
        &'life0 self,
        endpoint: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn TransportListener<Conn = Self::Conn>>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Factory to connect or accept connections using local sockets.

Required Associated Types§

Required Methods§

Source

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

Client side: connect to an endpoint (e.g., path or named pipe).

Source

fn bind<'life0, 'life1, 'async_trait>( &'life0 self, endpoint: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn TransportListener<Conn = Self::Conn>>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Server side: bind and accept incoming connections.

Implementors§