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]
fn clone(&self) -> Configuration
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Configuration
[src]
impl Default for Configuration
[src]
fn default() -> Configuration
[src]
impl PartialEq<Configuration> for Configuration
[src]
fn eq(&self, other: &Configuration) -> bool
[src]
fn ne(&self, other: &Configuration) -> bool
[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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
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,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,