[−][src]Struct finality_grandpa::voter_set::VoterSet
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.
pub fn voters(&self) -> &[(Id, u64)]
[src]
Get the voters.
Trait Implementations
impl<Id: Clone + Hash + Eq> Clone for VoterSet<Id>
[src]
fn clone(&self) -> 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
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.