Trait rings_core::swarm::impls::ConnectionManager
source · pub trait ConnectionManager {
// Required methods
fn disconnect<'life0, 'async_trait>(
&'life0 self,
did: Did
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn connect<'life0, 'async_trait>(
&'life0 self,
did: Did
) -> Pin<Box<dyn Future<Output = Result<Connection>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn connect_via<'life0, 'async_trait>(
&'life0 self,
did: Did,
next_hop: Did
) -> Pin<Box<dyn Future<Output = Result<Connection>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
A trait for managing connections.
Required Methods§
sourcefn disconnect<'life0, 'async_trait>(
&'life0 self,
did: Did
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn disconnect<'life0, 'async_trait>( &'life0 self, did: Did ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Asynchronously disconnects the connection associated with the provided DID.
sourcefn connect<'life0, 'async_trait>(
&'life0 self,
did: Did
) -> Pin<Box<dyn Future<Output = Result<Connection>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>( &'life0 self, did: Did ) -> Pin<Box<dyn Future<Output = Result<Connection>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Asynchronously establishes a new connection and returns the connection associated with the provided DID.
sourcefn connect_via<'life0, 'async_trait>(
&'life0 self,
did: Did,
next_hop: Did
) -> Pin<Box<dyn Future<Output = Result<Connection>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect_via<'life0, 'async_trait>( &'life0 self, did: Did, next_hop: Did ) -> Pin<Box<dyn Future<Output = Result<Connection>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Asynchronously establishes a new connection via a specified next hop DID and returns the connection associated with the provided DID.