[][src]Struct wybr::tally::vote_tree::VoteTree

pub struct VoteTree { /* fields omitted */ }

Methods

impl VoteTree[src]

pub fn new(candidates: u32) -> VoteTree[src]

pub fn get_candidates(&self) -> u32[src]

pub fn ballot_count(&self) -> u64[src]

pub fn stream_ballots<F: FnMut(u64, &[u32])>(&self, reader: &mut F)[src]

pub fn assign_votes(
    &self,
    eliminated: &HashSet<u32>
) -> (u64, HashMap<u32, u64>)
[src]

pub fn transfer_votes_fp(
    &self,
    weights: &HashMap<u32, u64>,
    base: u64,
    transfer: Transfer
) -> (u64, HashMap<u32, u64>)
[src]

pub fn count_ranks(&self, skipped: &HashSet<u32>) -> HashMap<(u32, u32), u64>[src]

Trait Implementations

impl Tally for VoteTree[src]

fn get_seats(&self) -> u32[src]

Return a number of seats

fn name_candidate(&self, id: u32) -> Option<&String>[src]

Get the name of a candidate from metadata

fn map_withdrawn<F: FnMut(u32)>(&self, f: F)[src]

Map over IDs of withdrawn candidates

fn from_blt_file(name: &str) -> Result<Self, VoteReadError> where
    Result<Self, VoteReadError>: FromIterator<VoteToken>, 
[src]

impl<'a> FromIterator<&'a (u64, Vec<u32>)> for VoteTree[src]

Iterator collector for fast&dirty creation of VoteTrees in tests and examples

Auto Trait Implementations

impl Send for VoteTree

impl Sync for VoteTree

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.