pub enum ReadOrBoth<R, W> {
Read(R),
Both(BothQuorums<R, W>),
}Expand description
A quorum rule that is either a read rule alone or a BothQuorums.
A consensus election picks the variant by how it orders leaders:
- With totally ordered ballots, as in Paxos, use
Read. Two leaders always differ in ballot, and a voter rejects entries from a ballot smaller than one it granted. So read quorums need to intersect only write quorums. - When two leaders of one term are not ordered, as in Raft, use
Both. Any two winning vote sets must then intersect, but two read quorums may be disjoint.
ids() returns the read IDs for Read, and the union of the read and write
IDs for Both, each ID once.
Variants§
Read(R)
Accepts an ID set when the read rule accepts it.
Both(BothQuorums<R, W>)
Accepts an ID set when both the read rule and the write rule accept it.
Trait Implementations§
Auto Trait Implementations§
impl<R, W> Freeze for ReadOrBoth<R, W>
impl<R, W> RefUnwindSafe for ReadOrBoth<R, W>
impl<R, W> Send for ReadOrBoth<R, W>
impl<R, W> Sync for ReadOrBoth<R, W>
impl<R, W> Unpin for ReadOrBoth<R, W>
impl<R, W> UnsafeUnpin for ReadOrBoth<R, W>
impl<R, W> UnwindSafe for ReadOrBoth<R, W>
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
Mutably borrows from an owned value. Read more