pub struct GenericOutcome<'a> { /* private fields */ }
Expand description

Multi-winner election outcome

Implementations§

source§

impl<'a> GenericOutcome<'a>

source

pub fn new<I, J>(
    winners: I,
    withdrawn: J,
    candidates: u32,
    sealed: bool,
    meta: &'a Metadata
) -> GenericOutcome<'a>where
    I: IntoIterator<Item = u32>,
    J: IntoIterator<Item = u32>,

Trait Implementations§

source§

impl<'a> Debug for GenericOutcome<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Display for GenericOutcome<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Outcome for GenericOutcome<'a>

source§

fn meta(&self) -> &Metadata

Reference to the election metadata
source§

fn deterministic(&self) -> bool

Specify whether the election was deterministic Read more
source§

fn candidate_count(&self) -> usize

source§

fn elected_count(&self) -> usize

source§

fn elected(&self) -> CandidateIterator<'_>

Return iterator of IDs of elected candidates
source§

fn winner(&self) -> Option<u32>

Return a single winner ID, if there is one, that is either the election scheme is single winner one or there is one seat in multi-winner election
source§

fn withdrawn_count(&self) -> usize

source§

fn withdrawn(&self) -> CandidateIterator<'_>

Return iterator of IDs of withdrawn candidates
source§

fn elected_names(&self) -> NamesIterator<'_>

Return iterator of elected candidate names Read more
source§

fn winner_name(&self) -> Option<String>

source§

fn withdrawn_names(&self) -> NamesIterator<'_>

Return iterator of names of withdrawn candidates

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for GenericOutcome<'a>

§

impl<'a> Send for GenericOutcome<'a>

§

impl<'a> Sync for GenericOutcome<'a>

§

impl<'a> Unpin for GenericOutcome<'a>

§

impl<'a> UnwindSafe for GenericOutcome<'a>

Blanket Implementations§

source§

impl<T> Any for Twhere
    T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere
    U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToString for Twhere
    T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere
    U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere
    U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.