Skip to main content

MessageSendBehaviour

Trait MessageSendBehaviour 

Source
pub trait MessageSendBehaviour<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

MessageSendBehaviour trait provides a default implementation for the good method, judging a node’s behavior based on its message sending capabilities. The “goodness” of a node is measured by comparing the sent and failed-to-send counts against a given threshold.

Provided Methods§

Source

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 message sending behavior.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§