Quorum

Trait Quorum 

Source
pub trait Quorum {
    type Item: Ord;

    // Required methods
    fn quorum<M: Faults>(&self) -> u32;
    fn max_faults<M: Faults>(&self) -> u32;
    fn key(&self, index: Participant) -> Option<&Self::Item>;
    fn index(&self, key: &Self::Item) -> Option<Participant>;
}
Expand description

Extension trait for Set participant sets providing quorum and index utilities.

Required Associated Types§

Source

type Item: Ord

The type of items in this set.

Required Methods§

Source

fn quorum<M: Faults>(&self) -> u32

Returns the quorum value for this participant set using the given fault model.

§Panics

Panics if the number of participants exceeds u32::MAX.

Source

fn max_faults<M: Faults>(&self) -> u32

Returns the maximum number of faults tolerated by this participant set.

§Panics

Panics if the number of participants exceeds u32::MAX.

Source

fn key(&self, index: Participant) -> Option<&Self::Item>

Returns the participant key at the given index.

Source

fn index(&self, key: &Self::Item) -> Option<Participant>

Returns the index for the given participant key, if present.

§Panics

Panics if the participant index exceeds u32::MAX.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: Ord> Quorum for Set<T>

Source§

type Item = T