pub trait FinalizationHandler<Data>:
Sync
+ Send
+ 'static {
// Required method
fn data_finalized(&mut self, data: Data);
// Provided method
fn unit_finalized(
&mut self,
_creator: NodeIndex,
_round: u16,
data: Option<Data>,
) { ... }
}Expand description
The source of finalization of the units that consensus produces.
The FinalizationHandler::data_finalized method is called whenever a piece of data input to the algorithm
using DataProvider::get_data has been finalized, in order of finalization.
Required Methods§
Sourcefn data_finalized(&mut self, data: Data)
fn data_finalized(&mut self, data: Data)
Data, provided by DataProvider::get_data, has been finalized. The calls to this function follow the order of finalization.
Provided Methods§
Sourcefn unit_finalized(
&mut self,
_creator: NodeIndex,
_round: u16,
data: Option<Data>,
)
fn unit_finalized( &mut self, _creator: NodeIndex, _round: u16, data: Option<Data>, )
A unit has been finalized. You can overwrite the default implementation for advanced finalization handling
in which case the method FinalizationHandler::data_finalized will not be called anymore if a unit is finalized.
Please note that this interface is less stable as it exposes intrinsics which migh be subject to change.
Do not implement this method and only implement FinalizationHandler::data_finalized unless you
absolutely know what you are doing.