ConsensusEngine

pub trait ConsensusEngine: Debug {
    // Required methods
    fn reach_consensus<'life0, 'life1, 'async_trait, T>(
        &'life0 self,
        proposal: T,
        participants: &'life1 [NodeId],
        timeout: Duration,
    ) -> Pin<Box<dyn Future<Output = Result<ConsensusResult<T>>> + Send + 'async_trait>>
       where T: 'async_trait + Serialize + for<'de> Deserialize<'de> + Clone + Send,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn elect_leader<'life0, 'life1, 'async_trait>(
        &'life0 self,
        candidates: &'life1 [NodeId],
        timeout: Duration,
    ) -> Pin<Box<dyn Future<Output = Result<NodeId>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_consensus_confidence(&self) -> f64;
}
Expand description

Consensus engine trait for distributed decision making

Required Methods§

Source

fn reach_consensus<'life0, 'life1, 'async_trait, T>( &'life0 self, proposal: T, participants: &'life1 [NodeId], timeout: Duration, ) -> Pin<Box<dyn Future<Output = Result<ConsensusResult<T>>> + Send + 'async_trait>>
where T: 'async_trait + Serialize + for<'de> Deserialize<'de> + Clone + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn elect_leader<'life0, 'life1, 'async_trait>( &'life0 self, candidates: &'life1 [NodeId], timeout: Duration, ) -> Pin<Box<dyn Future<Output = Result<NodeId>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_consensus_confidence(&self) -> f64

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§