Trait Monitor

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

    // Required method
    fn subscribe(
        &mut self,
    ) -> impl Future<Output = (Self::Index, Receiver<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 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, Receiver<Self::Index>)> + Send

Create a channel that will receive updates when the latest index (also provided) changes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§