[][src]Struct finality_grandpa::voter_set::VoterSet

pub struct VoterSet<Id: Hash + Eq> { /* fields omitted */ }

A voter set, with accompanying indices.

Methods

impl<Id: Hash + Eq> VoterSet<Id>[src]

pub fn info<'a>(&'a self, id: &Id) -> Option<&'a VoterInfo>[src]

Get the voter info for a voter.

pub fn len(&self) -> usize[src]

Get the length of the set.

pub fn contains_key(&self, id: &Id) -> bool[src]

Whether the set contains the key.

pub fn voter_by_index(&self, idx: usize) -> &(Id, u64)[src]

pub fn weight_by_index<'a>(&'a self, idx: usize) -> Option<u64>[src]

Get voter info by index.

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

Get the threshold weight.

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

Get the total weight.

Important traits for &'_ [u8]
pub fn voters(&self) -> &[(Id, u64)][src]

Get the voters.

Trait Implementations

impl<Id: Clone + Hash + Eq> Clone for VoterSet<Id>[src]

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<Id: PartialEq + Hash + Eq> PartialEq<VoterSet<Id>> for VoterSet<Id>[src]

impl<Id: Eq + Hash + Eq> Eq for VoterSet<Id>[src]

impl<Id: Hash + Eq + Clone + Ord> FromIterator<(Id, u64)> for VoterSet<Id>[src]

impl<Id: Debug + Hash + Eq> Debug for VoterSet<Id>[src]

Auto Trait Implementations

impl<Id> Send for VoterSet<Id> where
    Id: Send

impl<Id> Sync for VoterSet<Id> where
    Id: Sync

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

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

impl<T> From for 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.

impl<T> Erased for T