Skip to main content

QuorumBridge

Trait QuorumBridge 

Source
pub trait QuorumBridge<Other>
where Self: QuorumSet, Other: QuorumSet<Id = Self::Id>,
{ // Required method fn joint_with(&self, other: Other) -> Self; }
Expand description

Builds a joint quorum set that requires a quorum of each input.

Required Methods§

Source

fn joint_with(&self, other: Other) -> Self

Build the joint X of self and other: a set is a quorum of X exactly when it is a quorum of both self and other.

A change between two memberships with separate read and write quorum sets builds the joint membership with two calls: one joins the old and the new read quorum sets, and one joins the old and the new write quorum sets. Every joint read quorum is then a read quorum of both the old and the new membership, and every joint write quorum is a write quorum of both.

Let ~ be the QuorumIntersection relation. When read ~ write holds within the old and within the new membership, these hold too:

  • old read ~ joint write and old write ~ joint read
  • joint read ~ new write and joint write ~ new read
  • joint read ~ joint write

E.g. c₁c₂.joint_with(c₃) returns c₁c₂c₃, where cᵢcⱼ is a joint of cᵢ and cⱼ.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<ID> QuorumBridge<BTreeSet<ID>> for Vec<BTreeSet<ID>>
where ID: Ord + Clone,

Builds the joint of a joint quorum set and a flat config.

Source§

fn joint_with(&self, other: BTreeSet<ID>) -> Self

Return the configs of self followed by other. Return an empty joint when self is empty: an empty joint has no quorum, so a joint with it has no quorum either.

Source§

impl<ID> QuorumBridge<Vec<BTreeSet<ID>>> for Vec<BTreeSet<ID>>
where ID: Ord + Clone,

Builds the joint of the source and target joint configs.

Source§

fn joint_with(&self, other: Vec<BTreeSet<ID>>) -> Self

Return the configs of self followed by the configs of other. Return an empty joint when self or other is empty: an empty joint has no quorum, so a joint with it has no quorum either.

Implementors§

Source§

impl<Q> QuorumBridge<Joint<Q>> for Joint<Q>
where Q: QuorumSet + Clone, Q::Id: Ord,

Builds the joint of the source and target rules.