Skip to main content

Monitor

Trait Monitor 

Source
pub trait Monitor:
    Clone
    + Send
    + 'static {
    type Index;

    // Required method
    fn subscribe(
        &mut self,
    ) -> impl Future<Output = (Self::Index, IndexSubscription<Self::Index>)> + Send;
}
Expand description

Monitor is the interface an external actor can use to observe the progress of a consensus implementation.

Monitor is used to implement mechanisms that share the same set of active participants as consensus and/or perform some activity that requires some synchronization with the progress of consensus.

Monitor can be implemented using crate::Reporter to avoid introducing complexity into any particular consensus implementation.

Required Associated Types§

Source

type Index

Index is the type used to indicate the in-progress consensus decision.

Required Methods§

Source

fn subscribe( &mut self, ) -> impl Future<Output = (Self::Index, IndexSubscription<Self::Index>)> + Send

Returns the latest index and a subscription that yields the newest index whenever it has changed.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§