Struct raft::ProgressSet [−][src]
pub struct ProgressSet { /* fields omitted */ }
ProgressSet
contains several Progress
es,
which could be Leader
, Follower
and Learner
.
Methods
impl ProgressSet
[src]
impl ProgressSet
pub fn new(voter_size: usize, learner_size: usize) -> Self
[src]
pub fn new(voter_size: usize, learner_size: usize) -> Self
Creates a new ProgressSet.
pub fn voters(&self) -> &FxHashMap<u64, Progress>
[src]
pub fn voters(&self) -> &FxHashMap<u64, Progress>
Returns the status of voters.
pub fn learners(&self) -> &FxHashMap<u64, Progress>
[src]
pub fn learners(&self) -> &FxHashMap<u64, Progress>
Returns the status of learners.
pub fn nodes(&self) -> Vec<u64>
[src]
pub fn nodes(&self) -> Vec<u64>
Returns the ids of all known nodes.
pub fn learner_nodes(&self) -> Vec<u64>
[src]
pub fn learner_nodes(&self) -> Vec<u64>
Returns the ids of all known learners.
pub fn get(&self, id: u64) -> Option<&Progress>
[src]
pub fn get(&self, id: u64) -> Option<&Progress>
Grabs a reference to the progress of a node.
pub fn get_mut(&mut self, id: u64) -> Option<&mut Progress>
[src]
pub fn get_mut(&mut self, id: u64) -> Option<&mut Progress>
Grabs a mutable reference to the progress of a node.
pub fn iter(
&self
) -> impl Iterator<Item = (&u64, &Progress)>
[src]
pub fn iter(
&self
) -> impl Iterator<Item = (&u64, &Progress)>
Returns an iterator across all the nodes and their progress.
pub fn iter_mut(
&mut self
) -> impl Iterator<Item = (&u64, &mut Progress)>
[src]
pub fn iter_mut(
&mut self
) -> impl Iterator<Item = (&u64, &mut Progress)>
Returns a mutable iterator across all the nodes and their progress.
pub fn insert_voter(&mut self, id: u64, pr: Progress) -> Result<(), Error>
[src]
pub fn insert_voter(&mut self, id: u64, pr: Progress) -> Result<(), Error>
Adds a voter node
pub fn insert_learner(&mut self, id: u64, pr: Progress) -> Result<(), Error>
[src]
pub fn insert_learner(&mut self, id: u64, pr: Progress) -> Result<(), Error>
Adds a learner to the cluster
pub fn remove(&mut self, id: u64) -> Option<Progress>
[src]
pub fn remove(&mut self, id: u64) -> Option<Progress>
Removes the peer from the set of voters or learners.
pub fn promote_learner(&mut self, id: u64) -> Result<(), Error>
[src]
pub fn promote_learner(&mut self, id: u64) -> Result<(), Error>
Promote a learner to a peer.
Trait Implementations
impl Default for ProgressSet
[src]
impl Default for ProgressSet
fn default() -> ProgressSet
[src]
fn default() -> ProgressSet
Returns the "default value" for a type. Read more
impl Clone for ProgressSet
[src]
impl Clone for ProgressSet
fn clone(&self) -> ProgressSet
[src]
fn clone(&self) -> ProgressSet
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl Send for ProgressSet
impl Send for ProgressSet
impl Sync for ProgressSet
impl Sync for ProgressSet