Struct rings_node::measure::PeriodicMeasure
source · pub struct PeriodicMeasure { /* private fields */ }
Expand description
PeriodicMeasure
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.
Implementations§
source§impl PeriodicMeasure
impl PeriodicMeasure
sourcepub fn new(storage: PersistenceStorage) -> Self
pub fn new(storage: PersistenceStorage) -> Self
Create a new PeriodicMeasure
with the given storage.
Trait Implementations§
source§impl BehaviourJudgement for PeriodicMeasure
impl BehaviourJudgement for PeriodicMeasure
source§impl<const T: i16> ConnectBehaviour<T> for PeriodicMeasure
impl<const T: i16> ConnectBehaviour<T> for PeriodicMeasure
source§fn good<'life0, 'async_trait>(
&'life0 self,
did: Did
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn good<'life0, 'async_trait>( &'life0 self, did: Did ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: Sync + 'async_trait,
This asynchronous method returns a boolean indicating whether the node identified by
did
has a satisfactory connection behavior.source§impl Debug for PeriodicMeasure
impl Debug for PeriodicMeasure
source§impl Measure for PeriodicMeasure
impl Measure for PeriodicMeasure
source§impl<const T: i16> MessageRecvBehaviour<T> for PeriodicMeasure
impl<const T: i16> MessageRecvBehaviour<T> for PeriodicMeasure
source§fn good<'life0, 'async_trait>(
&'life0 self,
did: Did
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn good<'life0, 'async_trait>( &'life0 self, did: Did ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: Sync + 'async_trait,
This asynchronous method returns a boolean indicating whether the node identified by
did
has a satisfactory message receiving behavior.source§impl<const T: i16> MessageSendBehaviour<T> for PeriodicMeasure
impl<const T: i16> MessageSendBehaviour<T> for PeriodicMeasure
source§fn good<'life0, 'async_trait>(
&'life0 self,
did: Did
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn good<'life0, 'async_trait>( &'life0 self, did: Did ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: Sync + 'async_trait,
This asynchronous method returns a boolean indicating whether the node identified by
did
has a satisfactory message sending behavior.Auto Trait Implementations§
impl !RefUnwindSafe for PeriodicMeasure
impl Send for PeriodicMeasure
impl Sync for PeriodicMeasure
impl Unpin for PeriodicMeasure
impl !UnwindSafe for PeriodicMeasure
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
§impl<'a, T> AsTaggedExplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedExplicit<'a> for Twhere T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,
§impl<'a, T> AsTaggedImplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedImplicit<'a> for Twhere T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Upcastable for Twhere
T: Any + Send + Sync + 'static,
impl<T> Upcastable for Twhere T: Any + Send + Sync + 'static,
§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref