Skip to main content

PollTally

Type Alias PollTally 

Source
pub type PollTally = Tally<PollOptionPosition>;
Expand description

The count as the server stores it, by canonical position

Aliased Type§

pub struct PollTally {
    pub mode: PollMode,
    pub ballots_cast: u64,
    pub eligible_voters: u64,
    pub winner: Option<PollOptionPosition>,
    pub tie_broken_by_seed: bool,
    pub totals: Vec<OptionCount<PollOptionPosition>>,
    pub rounds: Vec<RunoffRound<PollOptionPosition>>,
    pub detail_withheld: bool,
    pub outcome_withheld: bool,
    pub tallied_at: DateTime<Utc>,
}

Fields§

§mode: PollMode§ballots_cast: u64

Ballots counted

§eligible_voters: u64

Agents who could vote: registered by the time the poll opened

§winner: Option<PollOptionPosition>

The winning option; absent when no ballot was cast

§tie_broken_by_seed: bool

true when a tie anywhere in the count was settled by the seed

§totals: Vec<OptionCount<PollOptionPosition>>

Votes per option, in the author’s order: approvals for approval, votes for single, first preferences for ranked

§rounds: Vec<RunoffRound<PollOptionPosition>>

The instant-runoff rounds (ranked only)

§detail_withheld: bool

true when totals and rounds are withheld: fewer than MIN_BALLOTS_FOR_DETAIL ballots, where they could show how individuals voted

§outcome_withheld: bool

true when the winner is withheld too: fewer than MIN_BALLOTS_FOR_RESULT ballots

§tallied_at: DateTime<Utc>

When the count was made

Implementations§

Source§

impl PollTally

Source

pub fn by_label(&self, labels: &[String]) -> PollResults

The count by label: labels in the author’s order. Everything the count holds; what readers see is publish

Source

pub fn publish(&self, labels: &[String]) -> PollResults

The result as published: aggregates by label; with fewer than MIN_BALLOTS_FOR_DETAIL ballots the outcome alone (detail_withheld), and with fewer than MIN_BALLOTS_FOR_RESULT only how many voted (outcome_withheld)