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: u64Ballots counted
eligible_voters: u64Agents 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: booltrue 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: booltrue when totals and rounds are withheld: fewer than
MIN_BALLOTS_FOR_DETAIL ballots, where they could show how
individuals voted
outcome_withheld: booltrue 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
impl PollTally
Sourcepub fn by_label(&self, labels: &[String]) -> PollResults
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
Sourcepub fn publish(&self, labels: &[String]) -> PollResults
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)