Skip to main content

Ballot

Trait Ballot 

Source
pub trait Ballot {
    type Signer;

    // Required methods
    fn view(&self) -> ViewNumber;
    fn epoch(&self) -> Option<EpochNumber>;
    fn signer(&self) -> Self::Signer;

    // Provided method
    fn epochs(&self) -> impl Iterator<Item = EpochNumber> { ... }
}
Expand description

Information about a vote.

Used by VoteCollector to handle incoming votes, i.e. reject duplicate votes by the same signer, or stale votes for GCed views, before even tallying the vote.

Required Associated Types§

Required Methods§

Source

fn view(&self) -> ViewNumber

Source

fn epoch(&self) -> Option<EpochNumber>

Source

fn signer(&self) -> Self::Signer

Provided Methods§

Source

fn epochs(&self) -> impl Iterator<Item = EpochNumber>

The epochs whose committees counting the vote reads, its own included.

The vote waits until every one of them is known.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T: NodeType, D> Ballot for SimpleVote<T, D>
where D: Voteable<T> + HasEpoch + 'static,

Implementors§