pub enum Command {
Noop,
Insert {
key: Bytes,
value: Bytes,
ttl_secs: Option<u64>,
},
Delete {
key: Bytes,
},
CompareAndSwap {
key: Bytes,
expected: Option<Bytes>,
value: Bytes,
},
}Expand description
Decoded KV operation — the unit of work delivered to a StateMachine.
Replaces raw proto Entry at the StateMachine::apply_chunk boundary.
The framework decodes wire bytes exactly once (in DefaultStateMachineHandler)
before dispatching; implementors never touch prost or proto types.
Variants§
Noop
Raft-internal no-op written by a newly elected leader.
SM must return ApplyResult::success(entry.index) and otherwise ignore it.
Cannot be filtered before reaching SM: omitting it would create gaps in
last_applied, breaking the index-tracking invariant in StateMachineWorker.
Insert
Fields
Delete
CompareAndSwap
Trait Implementations§
Source§impl TryFrom<WriteCommand> for Command
Single coupling point between the proto schema and the SM trait.
impl TryFrom<WriteCommand> for Command
Single coupling point between the proto schema and the SM trait.
When a new operation variant is added to WriteCommand, the compiler forces
an update here (non-exhaustive match), preventing silent omissions downstream.
impl StructuralPartialEq for Command
Auto Trait Implementations§
impl !Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
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<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