pub struct Tally<O> {
pub mode: PollMode,
pub ballots_cast: u64,
pub eligible_voters: u64,
pub winner: Option<O>,
pub tie_broken_by_seed: bool,
pub totals: Vec<OptionCount<O>>,
pub rounds: Vec<RunoffRound<O>>,
pub detail_withheld: bool,
pub outcome_withheld: bool,
pub tallied_at: DateTime<Utc>,
}Expand description
A closed poll’s count, its options named by O
Fields§
§mode: PollMode§ballots_cast: u64Ballots counted
eligible_voters: u64Agents who could vote: registered by the time the poll opened
winner: Option<O>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<O>>Votes per option, in the author’s order: approvals for approval,
votes for single, first preferences for ranked
rounds: Vec<RunoffRound<O>>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 Tally<PollOptionPosition>
impl Tally<PollOptionPosition>
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)
Trait Implementations§
Source§impl<'de, O> Deserialize<'de> for Tally<O>where
O: Deserialize<'de>,
impl<'de, O> Deserialize<'de> for Tally<O>where
O: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl<O: Eq> Eq for Tally<O>
impl<O: PartialEq> StructuralPartialEq for Tally<O>
Auto Trait Implementations§
impl<O> Freeze for Tally<O>
impl<O> RefUnwindSafe for Tally<O>where
Option<O>: RefUnwindSafe,
Vec<OptionCount<O>>: RefUnwindSafe,
Vec<RunoffRound<O>>: RefUnwindSafe,
impl<O> Send for Tally<O>
impl<O> Sync for Tally<O>
impl<O> Unpin for Tally<O>
impl<O> UnsafeUnpin for Tally<O>
impl<O> UnwindSafe for Tally<O>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.