pub trait Connector<M> {
// Required methods
fn connect_framed<'life0, 'async_trait>(
&'life0 self,
destination: SafeUrl,
peer: PeerId,
) -> Pin<Box<dyn Future<Output = ConnectResult<M>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn listen<'life0, 'async_trait>(
&'life0 self,
bind_addr: SocketAddr,
) -> Pin<Box<dyn Future<Output = Result<ConnectionListener<M>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn into_dyn(self) -> AnyConnector<M>
where Self: Sized + Send + Sync + Unpin + 'static { ... }
}
Expand description
Allows to connect to peers and to listen for incoming connections
Connections are message based (FramedTransport
) and should be
authenticated and encrypted for production deployments.
Required Methods§
Sourcefn connect_framed<'life0, 'async_trait>(
&'life0 self,
destination: SafeUrl,
peer: PeerId,
) -> Pin<Box<dyn Future<Output = ConnectResult<M>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect_framed<'life0, 'async_trait>(
&'life0 self,
destination: SafeUrl,
peer: PeerId,
) -> Pin<Box<dyn Future<Output = ConnectResult<M>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Connect to a destination
Sourcefn listen<'life0, 'async_trait>(
&'life0 self,
bind_addr: SocketAddr,
) -> Pin<Box<dyn Future<Output = Result<ConnectionListener<M>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn listen<'life0, 'async_trait>(
&'life0 self,
bind_addr: SocketAddr,
) -> Pin<Box<dyn Future<Output = Result<ConnectionListener<M>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Listen for incoming connections on bind_addr