Trait rings_core::swarm::impls::JudgeConnection
source · pub trait JudgeConnection: Judegement + ConnectionManager {
// Provided methods
fn disconnect<'life0, 'async_trait>(
&'life0 self,
did: Did
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + '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: Sync + '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: Sync + 'async_trait,
'life0: 'async_trait { ... }
}Expand description
A trait that combines the Judegement and ConnectionManager traits.
Provided Methods§
sourcefn disconnect<'life0, 'async_trait>(
&'life0 self,
did: Did
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + '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: Sync + 'async_trait, 'life0: 'async_trait,
Asynchronously disconnects the connection associated with the provided DID after recording the disconnection.
sourcefn connect<'life0, 'async_trait>(
&'life0 self,
did: Did
) -> Pin<Box<dyn Future<Output = Result<Connection>> + Send + 'async_trait>>where
Self: Sync + '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: Sync + 'async_trait, 'life0: 'async_trait,
Asynchronously establishes a new connection and returns the connection associated with the provided DID if should_connect returns true; otherwise, returns an error.
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: Sync + '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: Sync + '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 if should_connect returns true; otherwise, returns an error.