Skip to main content

Tally

Trait Tally 

Source
pub trait Tally<T: NodeType>: Send + 'static {
    type Vote: Send + 'static;
    type Output: Send + 'static;

    // Required methods
    fn new(m: EpochMembership<T>, l: UpgradeLock<T>) -> Self;
    fn add(&mut self, vote: Self::Vote) -> Option<Self::Output>;
    fn min_votes(&self) -> usize;
    fn has_signer(m: &EpochMembership<T>, signer: &T::SignatureKey) -> bool;
}
Expand description

How to count votes to form a certificate.

Required Associated Types§

Source

type Vote: Send + 'static

Source

type Output: Send + 'static

Required Methods§

Source

fn new(m: EpochMembership<T>, l: UpgradeLock<T>) -> Self

Source

fn add(&mut self, vote: Self::Vote) -> Option<Self::Output>

Source

fn min_votes(&self) -> usize

Source

fn has_signer(m: &EpochMembership<T>, signer: &T::SignatureKey) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T, V, Th> Tally<T> for SimpleTally<T, V, Th>
where T: NodeType, V: Vote<T> + Send + 'static, V::Commitment: 'static, Th: Threshold<T> + Send + 'static, SimpleCertificate<T, <V as Vote<T>>::Commitment, Th>: Certificate<T, V::Commitment, Voteable = V::Commitment> + HasEpoch + Send + 'static,

Source§

impl<T: NodeType, Th: Threshold<T> + Send + 'static> Tally<T> for TimeoutTally<T, Th>

Source§

impl<T: NodeType> Tally<T> for EpochRootTally<T>