pub enum ReplicaAckPolicy {
All,
SimpleMajority,
None,
}Expand description
Policy for how many replicas must acknowledge a commit before it is considered durable.
Variants§
All
All electable replicas must acknowledge the commit.
SimpleMajority
A simple majority of electable nodes (including the master) must acknowledge the commit.
None
No replica acknowledgment is required. The commit returns as soon as the master has written it locally.
Implementations§
Source§impl ReplicaAckPolicy
impl ReplicaAckPolicy
Sourcepub fn required_acks(&self, electable_count: u32) -> u32
pub fn required_acks(&self, electable_count: u32) -> u32
Returns the number of acknowledgments required for the given number of electable nodes in the group.
All: requireselectable_count - 1acks (all replicas).SimpleMajority: requires(electable_count / 2 + 1) - 1acks (majority minus the master itself).None: requires 0 acks.
Trait Implementations§
Source§impl Clone for ReplicaAckPolicy
impl Clone for ReplicaAckPolicy
Source§fn clone(&self) -> ReplicaAckPolicy
fn clone(&self) -> ReplicaAckPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReplicaAckPolicy
impl Debug for ReplicaAckPolicy
Source§impl Default for ReplicaAckPolicy
impl Default for ReplicaAckPolicy
Source§fn default() -> ReplicaAckPolicy
fn default() -> ReplicaAckPolicy
Returns the “default value” for a type. Read more
Source§impl Display for ReplicaAckPolicy
impl Display for ReplicaAckPolicy
Source§impl Hash for ReplicaAckPolicy
impl Hash for ReplicaAckPolicy
Source§impl PartialEq for ReplicaAckPolicy
impl PartialEq for ReplicaAckPolicy
Source§fn eq(&self, other: &ReplicaAckPolicy) -> bool
fn eq(&self, other: &ReplicaAckPolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for ReplicaAckPolicy
impl Eq for ReplicaAckPolicy
impl StructuralPartialEq for ReplicaAckPolicy
Auto Trait Implementations§
impl Freeze for ReplicaAckPolicy
impl RefUnwindSafe for ReplicaAckPolicy
impl Send for ReplicaAckPolicy
impl Sync for ReplicaAckPolicy
impl Unpin for ReplicaAckPolicy
impl UnsafeUnpin for ReplicaAckPolicy
impl UnwindSafe for ReplicaAckPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more