pub trait PrimaryCallback<N: Network>: Send + Sync {
// Required methods
fn try_advance_to_next_round(&self, current_round: u64) -> bool;
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 changes in the Primary, such as round advancement.
This is implemented by [BFT].
Required Methods§
Sourcefn try_advance_to_next_round(&self, current_round: u64) -> bool
fn try_advance_to_next_round(&self, current_round: u64) -> bool
Sourcefn 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,
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,
Add a certificated that was created by the primary or received from a peer.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".