[−][src]Struct wybr::tally::vote_tree::VoteTree
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]
&self,
eliminated: &HashSet<u32>
) -> (u64, HashMap<u32, u64>)
pub fn transfer_votes_fp(
&self,
weights: &HashMap<u32, u64>,
base: u64,
transfer: Transfer
) -> (u64, HashMap<u32, u64>)
[src]
&self,
weights: &HashMap<u32, u64>,
base: u64,
transfer: Transfer
) -> (u64, HashMap<u32, u64>)
pub fn count_ranks(&self, skipped: &HashSet<u32>) -> HashMap<(u32, u32), u64>
[src]
Trait Implementations
impl Tally for VoteTree
[src]
fn get_meta(&self) -> &Metadata
[src]
fn get_candidates(&self) -> u32
[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]
Result<Self, VoteReadError>: FromIterator<VoteToken>,
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
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>,