Struct raft::JointConfig [−][src]
A configuration of two groups of (possibly overlapping) majority configurations. Decisions require the support of both majorities.
Implementations
impl Configuration
[src][−]
pub fn new(voters: HashSet<u64, BuildHasherDefault<FxHasher>>) -> Configuration
[src][−]
Creates a new configuration using the given IDs.
pub fn with_capacity(cap: usize) -> Configuration
[src][−]
Creates an empty configuration with given capacity.
pub fn committed_index(
&self,
use_group_commit: bool,
l: &impl AckedIndexer
) -> (u64, bool)
[src][−]
&self,
use_group_commit: bool,
l: &impl AckedIndexer
) -> (u64, bool)
Returns the largest committed index for the given joint quorum. An index is jointly committed if it is committed in both constituent majorities.
The bool flag indicates whether the index is computed by group commit algorithm successfully. It’s true only when both majorities use group commit.
pub fn vote_result(&self, check: impl Fn(u64) -> Option<bool>) -> VoteResult
[src][−]
Takes a mapping of voters to yes/no (true/false) votes and returns a result indicating whether the vote is pending, lost, or won. A joint quorum requires both majority quorums to vote in favor.
pub fn clear(&mut self)
[src][−]
Clears all IDs.
pub fn is_singleton(&self) -> bool
[src][−]
Returns true if (and only if) there is only one voting member (i.e. the leader) in the current configuration.
pub fn ids(&self) -> Union<'_>
[src][−]
Returns an iterator over two hash set without cloning.
pub fn contains(&self, id: u64) -> bool
[src][−]
Check if an id is a voter.
Trait Implementations
impl Clone for Configuration
[src][+]
impl Debug for Configuration
[src][+]
impl Default for Configuration
[src][+]
impl PartialEq<Configuration> for Configuration
[src][+]
impl StructuralPartialEq for Configuration
[src]
Auto Trait Implementations
impl RefUnwindSafe for Configuration
impl Send for Configuration
impl Sync for Configuration
impl Unpin for Configuration
impl UnwindSafe for Configuration
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
[src]
T: Send + Sync + UnwindSafe + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src][+]
V: MultiLane<T>,