Struct raft::JointConfig[][src]

pub struct JointConfig { /* fields omitted */ }

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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

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

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]