Skip to main content

SyncCallback

Trait SyncCallback 

Source
pub trait SyncCallback<N: Network>: Send + Sync {
    // Required methods
    fn sync_dag_at_bootup<'life0, 'async_trait>(
        &'life0 self,
        certificates: Vec<BatchCertificate<N>>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn add_new_certificate<'life0, 'async_trait>(
        &'life0 self,
        certificate: BatchCertificate<N>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

This callback trait allows listening to synchronization updates, such as discorvering new BatchCertificates. This is currently used by BFT.

Required Methods§

Source

fn sync_dag_at_bootup<'life0, 'async_trait>( &'life0 self, certificates: Vec<BatchCertificate<N>>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn add_new_certificate<'life0, 'async_trait>( &'life0 self, certificate: BatchCertificate<N>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Sends a new certificate.

Implementors§

Source§

impl<N: Network> SyncCallback<N> for BFT<N>