pub enum VotingMethod {
Show 15 variants
AMS,
FPP,
IRV,
NOR,
OPV,
RCV,
SPV,
STV,
Cumulative,
Approval,
Block,
SupporterList,
Partisan,
SupplementaryVote,
Other,
}Expand description
Voting method used in the election.
Variants§
AMS
Additional Member System
FPP
First Past the Post
IRV
Instant Runoff Voting
NOR
Norwegian Voting
OPV
Optional Preferential Voting
RCV
Ranked Choice Voting
SPV
Single Preferential Vote
STV
Single Transferable Vote
Cumulative
Cumulative Voting
Approval
Approval Voting
Block
Block Voting
SupporterList
Supporter List Voting
Partisan
Partisan Voting
SupplementaryVote
Supplementary Vote
Other
Other Voting Method
Implementations§
Source§impl VotingMethod
impl VotingMethod
Sourcepub fn new(s: impl AsRef<str>) -> Result<Self, EMLError>
pub fn new(s: impl AsRef<str>) -> Result<Self, EMLError>
Create a new VotingMethod from a string, validating its format.
Sourcepub fn from_eml_value(
s: impl AsRef<str>,
) -> Result<Self, UnknownVotingMethodError>
pub fn from_eml_value( s: impl AsRef<str>, ) -> Result<Self, UnknownVotingMethodError>
Create a VotingMethod from a &str, if possible.
Sourcepub fn to_eml_value(&self) -> &'static str
pub fn to_eml_value(&self) -> &'static str
Get the &str representation of this VotingMethod.
Trait Implementations§
Source§impl Clone for VotingMethod
impl Clone for VotingMethod
Source§fn clone(&self) -> VotingMethod
fn clone(&self) -> VotingMethod
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VotingMethod
impl Debug for VotingMethod
Source§impl Hash for VotingMethod
impl Hash for VotingMethod
Source§impl PartialEq for VotingMethod
impl PartialEq for VotingMethod
Source§impl StringValueData for VotingMethod
impl StringValueData for VotingMethod
Source§type Error = UnknownVotingMethodError
type Error = UnknownVotingMethodError
The error type returned when parsing the value from a string fails.
Source§fn parse_from_str(s: &str) -> Result<Self, Self::Error>where
Self: Sized,
fn parse_from_str(s: &str) -> Result<Self, Self::Error>where
Self: Sized,
Parse the value from a string.
Source§fn to_raw_value(&self) -> String
fn to_raw_value(&self) -> String
Convert the value to its raw string representation.
impl Copy for VotingMethod
impl Eq for VotingMethod
impl StructuralPartialEq for VotingMethod
Auto Trait Implementations§
impl Freeze for VotingMethod
impl RefUnwindSafe for VotingMethod
impl Send for VotingMethod
impl Sync for VotingMethod
impl Unpin for VotingMethod
impl UnsafeUnpin for VotingMethod
impl UnwindSafe for VotingMethod
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
Mutably borrows from an owned value. Read more