[−][src]Struct wybr::methods::irv::Irv
A builder for the setup of an instant-runoff count
See the module level documentation for more.
Default configuration can be generated with Irv::new(&tally)
, where tally
is a VoteTree
object.
Count is triggered by the run()
method, which returns a solitary winner, or an error.
Methods
impl<'a> Irv<'a>
[src]
pub fn new(tally: &'a VoteTree) -> Self
[src]
Acquire reference to a vote tally and initiate default configuration, which can be altered with other builder methods. The default configuration involved using withdraw list pulled from the tally and seed equal to 21.
pub fn withdraw<I>(&mut self, withdraw: I) -> &mut Self where
I: IntoIterator<Item = u32>,
[src]
I: IntoIterator<Item = u32>,
Alter a list of withdrawn candidates, which are not considered in count.
pub fn seed(&mut self, seed: u32) -> &mut Self
[src]
Alters the random seed potentially used by the election algorithm to break ties.
pub fn run(&self) -> Result<GenericOutcome<'a>, ElectionError>
[src]
Performs Instant-runoff STV election
Errors
NotEnoughCandidates
, in case there is less candidates then seats or no votes
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>,