Struct fbas_analyzer::QuorumSet
source · pub struct QuorumSet {
pub threshold: usize,
pub validators: Vec<NodeId>,
pub inner_quorum_sets: Vec<QuorumSet>,
}
Fields§
§threshold: usize
§validators: Vec<NodeId>
§inner_quorum_sets: Vec<QuorumSet>
Implementations§
source§impl QuorumSet
impl QuorumSet
sourcepub fn assume_split_faulty(&mut self, nodes: &NodeIdSet)
pub fn assume_split_faulty(&mut self, nodes: &NodeIdSet)
This corresponds to the delete operation from Mazières’s original FBAS/SCP paper.
source§impl QuorumSet
impl QuorumSet
pub fn new( validators: Vec<NodeId>, inner_quorum_sets: Vec<QuorumSet>, threshold: usize ) -> Self
sourcepub fn new_unsatisfiable() -> Self
pub fn new_unsatisfiable() -> Self
A quorum set that basically marks a node as broken. It is never satisfied and can therefore never be part of a quorum.
sourcepub fn new_empty() -> Self
pub fn new_empty() -> Self
A quorum set that is always satisfiable and induces a one-node quorum.
pub fn contained_nodes(&self) -> NodeIdSet
sourcepub fn contains_duplicates(&self) -> bool
pub fn contains_duplicates(&self) -> bool
Whether some nodes appear more than once
pub fn is_satisfiable(&self) -> bool
pub fn is_quorum_slice(&self, node_set: &NodeIdSet) -> bool
sourcepub fn to_quorum_slices(&self) -> Vec<NodeIdSet>
pub fn to_quorum_slices(&self) -> Vec<NodeIdSet>
Each valid quorum slice for this quorum set is a superset (i.e., equal to or a proper superset of) of at least one of the sets returned by this function. The slices returned here are not necessarily minimal! Also: The returned slices are not (yet) valid quorum slices for a specific node; for that we would need to make sure that that the node itself is included in the slices (e.g., by inserting it into each slice).
sourcepub fn has_nonintersecting_quorum_slices(
&self
) -> Option<(NodeIdSet, NodeIdSet)>
pub fn has_nonintersecting_quorum_slices( &self ) -> Option<(NodeIdSet, NodeIdSet)>
Returns some pair of nonintersecting slices if there are any, None
otherwise.
source§impl QuorumSet
impl QuorumSet
pub fn into_pretty_quorum_set( self, fbas: &Fbas, groupings: Option<&Groupings<'_>> ) -> PrettyQuorumSet
Trait Implementations§
source§impl AnalysisResult for QuorumSet
impl AnalysisResult for QuorumSet
fn into_id_string(self) -> String
fn into_pretty_string( self, fbas: &Fbas, groupings: Option<&Groupings<'_>> ) -> String
fn into_describe_string(self) -> String
source§impl Ord for QuorumSet
impl Ord for QuorumSet
source§impl PartialEq for QuorumSet
impl PartialEq for QuorumSet
source§impl PartialOrd for QuorumSet
impl PartialOrd for QuorumSet
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Eq for QuorumSet
impl StructuralEq for QuorumSet
impl StructuralPartialEq for QuorumSet
Auto Trait Implementations§
impl RefUnwindSafe for QuorumSet
impl Send for QuorumSet
impl Sync for QuorumSet
impl Unpin for QuorumSet
impl UnwindSafe for QuorumSet
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.