pub struct VoterSet { /* private fields */ }Expand description
The authoritative voter set, ordered by node id.
Implementations§
Source§impl VoterSet
impl VoterSet
pub fn from_voters(voters: impl IntoIterator<Item = Voter>) -> Self
pub fn contains(&self, id: NodeId) -> bool
pub fn get(&self, id: NodeId) -> Option<&Voter>
pub fn ids(&self) -> BTreeSet<NodeId>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> impl Iterator<Item = &Voter>
Sourcepub fn with_voter(&self, voter: Voter) -> Self
pub fn with_voter(&self, voter: Voter) -> Self
Return a copy with voter added or replaced.
Sourcepub fn without_voter(&self, id: NodeId) -> Self
pub fn without_voter(&self, id: NodeId) -> Self
Return a copy with id removed.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for VoterSet
impl<'de> Deserialize<'de> for VoterSet
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for VoterSet
impl StructuralPartialEq for VoterSet
Auto Trait Implementations§
impl Freeze for VoterSet
impl RefUnwindSafe for VoterSet
impl Send for VoterSet
impl Sync for VoterSet
impl Unpin for VoterSet
impl UnsafeUnpin for VoterSet
impl UnwindSafe for VoterSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more