[−][src]Struct raft::ProgressSet
ProgressSet
contains several Progress
es,
which could be Leader
, Follower
and Learner
.
Methods
impl ProgressSet
[src]
pub fn new(voter_size: usize, learner_size: usize) -> Self
[src]
Creates a new ProgressSet.
pub fn voters(&self) -> &FxHashMap<u64, Progress>
[src]
Returns the status of voters.
pub fn learners(&self) -> &FxHashMap<u64, Progress>
[src]
Returns the status of learners.
pub fn nodes(&self) -> Vec<u64>
[src]
Returns the ids of all known nodes.
pub fn learner_nodes(&self) -> Vec<u64>
[src]
Returns the ids of all known learners.
pub fn get(&self, id: u64) -> Option<&Progress>
[src]
Grabs a reference to the progress of a node.
pub fn get_mut(&mut self, id: u64) -> Option<&mut Progress>
[src]
Grabs a mutable reference to the progress of a node.
pub fn iter(&self) -> impl Iterator<Item = (&u64, &Progress)>
[src]
Returns an iterator across all the nodes and their progress.
pub fn iter_mut(&mut self) -> impl Iterator<Item = (&u64, &mut Progress)>
[src]
Returns a mutable iterator across all the nodes and their progress.
pub fn insert_voter(&mut self, id: u64, pr: Progress) -> Result<(), Error>
[src]
Adds a voter node
pub fn insert_learner(&mut self, id: u64, pr: Progress) -> Result<(), Error>
[src]
Adds a learner to the cluster
pub fn remove(&mut self, id: u64) -> Option<Progress>
[src]
Removes the peer from the set of voters or learners.
pub fn promote_learner(&mut self, id: u64) -> Result<(), Error>
[src]
Promote a learner to a peer.
Trait Implementations
impl Clone for ProgressSet
[src]
fn clone(&self) -> ProgressSet
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for ProgressSet
[src]
fn default() -> ProgressSet
[src]
Auto Trait Implementations
impl Send for ProgressSet
impl Sync for ProgressSet
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut 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> 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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,