#[repr(i32)]pub enum WriteConditionKind {
WriteConditionNone = 0,
WriteConditionIfAbsent = 1,
WriteConditionIfPresent = 2,
WriteConditionIfValueEquals = 3,
WriteConditionIfReadSetUnchanged = 4,
WriteConditionIfSeqEquals = 5,
}Expand description
Predicate for a conditional batch gate. Values are deliberately prefixed because proto enum variants share package-level generated names in some languages.
Variants§
WriteConditionNone = 0
WriteConditionIfAbsent = 1
WriteConditionIfPresent = 2
WriteConditionIfValueEquals = 3
WriteConditionIfReadSetUnchanged = 4
Multi-key optimistic gate: apply the WHOLE batch only if every entry in
read_set still has its observed sequence. Unlike the single-key kinds
above, the predicate spans keys the batch does not write, which is what
makes snapshot isolation expressible on the generic KV wire instead of
only through the agent-specific transaction RPCs.
WriteConditionIfSeqEquals = 5
Single-key CAS on the engine sequence: apply only if the gate key EXISTS
and is still at exactly condition_seq.
Not expressible as a one-key read_set. That gate means “not overwritten
since” — it rejects only a NEWER version (latest > observed), so an
ABSENT key passes it and the write silently CREATES the row. This one means
“still exactly this version, and still there”, which is what a fenced
compare-and-swap actually promises.
Implementations§
Source§impl WriteConditionKind
impl WriteConditionKind
Sourcepub fn from_i32(value: i32) -> Option<WriteConditionKind>
👎Deprecated: Use the TryFrom<i32> implementation instead
pub fn from_i32(value: i32) -> Option<WriteConditionKind>
Use the TryFrom<i32> implementation instead
Converts an i32 to a WriteConditionKind, or None if value is not a valid variant.
Source§impl WriteConditionKind
impl WriteConditionKind
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§
Source§impl Clone for WriteConditionKind
impl Clone for WriteConditionKind
Source§fn clone(&self) -> WriteConditionKind
fn clone(&self) -> WriteConditionKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for WriteConditionKind
Source§impl Debug for WriteConditionKind
impl Debug for WriteConditionKind
Source§impl Default for WriteConditionKind
impl Default for WriteConditionKind
Source§fn default() -> WriteConditionKind
fn default() -> WriteConditionKind
impl Eq for WriteConditionKind
Source§impl From<WriteConditionKind> for i32
impl From<WriteConditionKind> for i32
Source§fn from(value: WriteConditionKind) -> i32
fn from(value: WriteConditionKind) -> i32
Source§impl Hash for WriteConditionKind
impl Hash for WriteConditionKind
Source§impl Ord for WriteConditionKind
impl Ord for WriteConditionKind
Source§fn cmp(&self, other: &WriteConditionKind) -> Ordering
fn cmp(&self, other: &WriteConditionKind) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for WriteConditionKind
impl PartialEq for WriteConditionKind
Source§impl PartialOrd for WriteConditionKind
impl PartialOrd for WriteConditionKind
impl StructuralPartialEq for WriteConditionKind
Source§impl TryFrom<i32> for WriteConditionKind
impl TryFrom<i32> for WriteConditionKind
Source§type Error = UnknownEnumValue
type Error = UnknownEnumValue
Source§fn try_from(value: i32) -> Result<WriteConditionKind, UnknownEnumValue>
fn try_from(value: i32) -> Result<WriteConditionKind, UnknownEnumValue>
Auto Trait Implementations§
impl Freeze for WriteConditionKind
impl RefUnwindSafe for WriteConditionKind
impl Send for WriteConditionKind
impl Sync for WriteConditionKind
impl Unpin for WriteConditionKind
impl UnsafeUnpin for WriteConditionKind
impl UnwindSafe for WriteConditionKind
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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