Trait rings_core::measure::Measure

source ·
pub trait Measure {
    // Required methods
    fn incr<'life0, 'async_trait>(
        &'life0 self,
        did: Did,
        counter: MeasureCounter
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_count<'life0, 'async_trait>(
        &'life0 self,
        did: Did,
        counter: MeasureCounter
    ) -> Pin<Box<dyn Future<Output = u64> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Measure is used to assess the reliability of peers by counting their behaviour. It currently count the number of sent and received messages in a given period (1 hour). The method Measure::incr should be called in the proper places.

Required Methods§

source

fn incr<'life0, 'async_trait>( &'life0 self, did: Did, counter: MeasureCounter ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

incr increments the counter of the given peer.

source

fn get_count<'life0, 'async_trait>( &'life0 self, did: Did, counter: MeasureCounter ) -> Pin<Box<dyn Future<Output = u64> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

get_count returns the counter of the given peer.

Implementors§