[−][src]Enum wybr::tally::VoteToken
VoteToken represents an unit of information parsed from the input file
Wybr I/O is based on an idea that ballot file parser shall return an iterator of VoteToken
s,
and they can be collected into something that is Tally
, currently VoteMatrix
or VoteTree
.
Finally, either of this is then passed to some vote counting method or other tool.
Variants
DeclareCandidates(u32)
Candidate number declaration; must happen before any Vote
or Ballot*
DeclareSeats(u32)
Seats (number of candidates to be elected) declaration; ignored by some methods
WithdrawCandidate(u32)
Withdraw certain candidate of a given ID; ignored by some methods
BallotRepeat(u64)
Declare how many times the current ballot was observed; obligatory
Vote(i32, u32)
Vote -- priority (the lower the better, i32::MAX
is reserved) and candidate ID
CandidateName(u32, String)
Declare candidate name; optional
ElectionTitle(String)
Declare election name; optional
EndBallot
Finish current ballot; obligatory
EndBallots
Expect no more ballot in this iterator; obligatory
ReadFailure(VoteReadError)
Read failure
Trait Implementations
impl FromIterator<VoteToken> for Result<VoteMatrix, VoteReadError>
[src]
fn from_iter<I: IntoIterator<Item = VoteToken>>(i: I) -> Self
[src]
impl FromIterator<VoteToken> for Result<VoteTree, VoteReadError>
[src]
Iterator collector for creating VoteTree
from a stream of VoteToken
s, as returned by ballot
file parsers or user-defined sources like DB cursors, etc.
fn from_iter<I: IntoIterator<Item = VoteToken>>(i: I) -> Self
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,