#[repr(i32)]pub enum WitnessOp {
Unspecified = 0,
Lease = 1,
Alone = 2,
InSync = 3,
Claim = 4,
Handover = 5,
}Variants§
Unspecified = 0
Lease = 1
Renew the primary’s lease, or learn who the primary is. On a witness without a primary, the first node to ask becomes the primary of term 1.
Alone = 2
The primary commits without its standby: the standby may not be made the primary.
InSync = 3
The primary’s standby standby holds every write again.
Claim = 4
The in-sync standby takes the primary’s place: granted once the primary’s lease expired.
Handover = 5
The primary of term gives its place to the standby in sync (a planned switchover):
its lease ends now, and the standby’s claim is granted without waiting for it.
Implementations§
Source§impl WitnessOp
impl WitnessOp
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
impl Copy for WitnessOp
impl Eq for WitnessOp
Source§impl Ord for WitnessOp
impl Ord for WitnessOp
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for WitnessOp
impl PartialOrd for WitnessOp
impl StructuralPartialEq for WitnessOp
Auto Trait Implementations§
impl Forget for WitnessOp
impl Freeze for WitnessOp
impl Move for WitnessOp
impl RefUnwindSafe for WitnessOp
impl Send for WitnessOp
impl Sync for WitnessOp
impl Unpin for WitnessOp
impl UnsafeUnpin for WitnessOp
impl UnwindSafe for WitnessOp
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request