Trait LeaderSelection
pub trait LeaderSelection {
type Block: Block;
type Error: Error;
type LeaderId: LeaderId;
type State: State;
// Required methods
fn retrieve(state: &Self::State) -> Self;
fn get_leader_at(
&self,
date: <Self::Block as Block>::Date,
) -> Result<Self::LeaderId, Self::Error>;
}
Expand description
interface for the leader selection algorithm
this is the interface that is responsible to verify the Block are created by the right Leaders (i.e. that everyone follows the consensus algorithm).
This is also the same interface that is used to detect if we are the leader for the block at the given date.
Required Associated Types§
Required Methods§
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.