[][src]Struct raft::ProgressSet

pub struct ProgressSet { /* fields omitted */ }

ProgressSet contains several Progresses, 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_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Default for ProgressSet[src]

Auto Trait Implementations

impl Send for ProgressSet

impl Sync for ProgressSet

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<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> 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> Any for T where
    T: 'static + ?Sized
[src]