pub struct JointConfig { /* private fields */ }
Expand description
A configuration of two groups of (possibly overlapping) majority configurations. Decisions require the support of both majorities.
Implementations§
source§impl Configuration
impl Configuration
sourcepub fn new(voters: HashSet<u64, BuildHasherDefault<FxHasher>>) -> Configuration
pub fn new(voters: HashSet<u64, BuildHasherDefault<FxHasher>>) -> Configuration
Creates a new configuration using the given IDs.
sourcepub fn with_capacity(cap: usize) -> Configuration
pub fn with_capacity(cap: usize) -> Configuration
Creates an empty configuration with given capacity.
sourcepub fn committed_index(
&self,
use_group_commit: bool,
l: &impl AckedIndexer,
) -> (u64, bool)
pub fn committed_index( &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.
sourcepub fn vote_result(&self, check: impl Fn(u64) -> Option<bool>) -> VoteResult
pub fn vote_result(&self, check: impl Fn(u64) -> Option<bool>) -> VoteResult
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.
sourcepub fn is_singleton(&self) -> bool
pub fn is_singleton(&self) -> bool
Returns true if (and only if) there is only one voting member (i.e. the leader) in the current configuration.
Trait Implementations§
source§impl Clone for Configuration
impl Clone for Configuration
source§fn clone(&self) -> Configuration
fn clone(&self) -> Configuration
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Configuration
impl Debug for Configuration
source§impl Default for Configuration
impl Default for Configuration
source§fn default() -> Configuration
fn default() -> Configuration
source§impl PartialEq for Configuration
impl PartialEq for Configuration
impl Eq for Configuration
impl StructuralPartialEq for Configuration
Auto Trait Implementations§
impl Freeze for Configuration
impl RefUnwindSafe for Configuration
impl Send for Configuration
impl Sync for Configuration
impl Unpin for Configuration
impl UnwindSafe for Configuration
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)