Trait rings_core::measure::ConnectBehaviour
source · pub trait ConnectBehaviour<const THRESHOLD: i64>: Measure {
// Provided method
fn good<'life0, 'async_trait>(
&'life0 self,
did: Did
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
}Expand description
ConnectBehaviour trait offers a default implementation for the good method, providing a judgement
based on a node’s behavior in establishing connections.
The “goodness” of a node is measured by comparing the connection and disconnection counts against a given threshold.
Provided Methods§
sourcefn good<'life0, 'async_trait>(
&'life0 self,
did: Did
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn good<'life0, 'async_trait>(
&'life0 self,
did: Did
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
This asynchronous method returns a boolean indicating whether the node identified by did has a satisfactory connection behavior.