pub trait Quorum {
type Item: Ord;
// Required methods
fn quorum(&self) -> u32;
fn max_faults(&self) -> u32;
fn key(&self, index: u32) -> Option<&Self::Item>;
fn index(&self, key: &Self::Item) -> Option<u32>;
}Expand description
Extension trait for Set participant sets providing quorum and index utilities.
Required Associated Types§
Required Methods§
Sourcefn quorum(&self) -> u32
fn quorum(&self) -> u32
Returns the quorum value (2f+1) for this participant set.
§Panics
Panics if the number of participants exceeds u32::MAX.
Sourcefn max_faults(&self) -> u32
fn max_faults(&self) -> u32
Returns the maximum number of faults (f) tolerated by this participant set.
§Panics
Panics if the number of participants exceeds u32::MAX.