Trait Consensus

Source
pub trait Consensus: Send + Sync {
    // Required methods
    fn set_proposal<'life0, 'async_trait>(
        &'life0 self,
        ctx: Context,
        proposal: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = ProtocolResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn set_vote<'life0, 'async_trait>(
        &'life0 self,
        ctx: Context,
        vote: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = ProtocolResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn set_qc<'life0, 'async_trait>(
        &'life0 self,
        ctx: Context,
        qc: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = ProtocolResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update_epoch<'life0, 'async_trait>(
        &'life0 self,
        ctx: Context,
        msg: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = ProtocolResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn set_proposal<'life0, 'async_trait>( &'life0 self, ctx: Context, proposal: Vec<u8>, ) -> Pin<Box<dyn Future<Output = ProtocolResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Network set a received signed proposal to consensus.

Source

fn set_vote<'life0, 'async_trait>( &'life0 self, ctx: Context, vote: Vec<u8>, ) -> Pin<Box<dyn Future<Output = ProtocolResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Network set a received signed vote to consensus.

Source

fn set_qc<'life0, 'async_trait>( &'life0 self, ctx: Context, qc: Vec<u8>, ) -> Pin<Box<dyn Future<Output = ProtocolResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Network set a received quorum certificate to consensus.

Source

fn update_epoch<'life0, 'async_trait>( &'life0 self, ctx: Context, msg: Vec<u8>, ) -> Pin<Box<dyn Future<Output = ProtocolResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Update an epoch to consensus. This may be either a rich status from the executor or a synchronous epoch that need to be insert to the database.

Implementors§