[][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]

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

Performs copy-assignment from source. Read more

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

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

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

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

Auto Trait Implementations

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

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

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

impl<Id> UnwindSafe for VoterSet<Id> where
    Id: RefUnwindSafe + UnwindSafe

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

Blanket Implementations

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

impl<T> From<T> for T[src]

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Erased for T