pub trait ConsensusFeed:
Send
+ Sync
+ 'static {
// Required methods
fn get_finalization(
&self,
query: Query,
) -> impl Future<Output = Option<CertifiedBlock>> + Send;
fn get_latest(&self) -> impl Future<Output = ConsensusState> + Send;
fn subscribe(&self) -> impl Future<Output = Option<Receiver<Event>>> + Send;
fn get_identity_transition_proof(
&self,
from_epoch: Option<u64>,
full: bool,
) -> impl Future<Output = Result<IdentityTransitionResponse, IdentityProofError>> + Send;
}Expand description
Trait for accessing consensus feed data.
Required Methods§
Sourcefn get_finalization(
&self,
query: Query,
) -> impl Future<Output = Option<CertifiedBlock>> + Send
fn get_finalization( &self, query: Query, ) -> impl Future<Output = Option<CertifiedBlock>> + Send
Get a finalization by query (supports Latest or Height).
Sourcefn get_latest(&self) -> impl Future<Output = ConsensusState> + Send
fn get_latest(&self) -> impl Future<Output = ConsensusState> + Send
Get the current consensus state (latest finalized + latest notarized).
Sourcefn subscribe(&self) -> impl Future<Output = Option<Receiver<Event>>> + Send
fn subscribe(&self) -> impl Future<Output = Option<Receiver<Event>>> + Send
Subscribe to consensus events.
Sourcefn get_identity_transition_proof(
&self,
from_epoch: Option<u64>,
full: bool,
) -> impl Future<Output = Result<IdentityTransitionResponse, IdentityProofError>> + Send
fn get_identity_transition_proof( &self, from_epoch: Option<u64>, full: bool, ) -> impl Future<Output = Result<IdentityTransitionResponse, IdentityProofError>> + Send
Get identity transition proofs (full DKG events where network public key changed).
from_epoch: Optional epoch to start searching from (defaults to latest finalized)full: If true, return all transitions back to genesis; if false, return only the most recent
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.