pub struct WatchEvent {
pub event_type: WatchEventType,
pub key: Bytes,
pub value: Bytes,
pub prev_value: Option<Bytes>,
pub revision: u64,
}Expand description
Watch event types and handles — available when the watch feature is enabled.
Use these when implementing embedded watch handlers:
ⓘ
use d_engine::{WatchEventType, WatcherHandle, WatchEvent};Opaque watch event delivered to callers.
All fields use standard Rust types — callers never need to import proto types.
prev_value semantics:
None— watcher was registered withprev_kv = false, or the event isProgress/Canceled(not a data mutation).Some(Bytes::new())— watcher hasprev_kv = trueand the key did not exist before this write (fresh insert).Some(v)— watcher hasprev_kv = trueandvis the previous value.
Fields§
§event_type: WatchEventType§key: Bytes§value: Bytes§prev_value: Option<Bytes>§revision: u64Trait Implementations§
Source§impl Clone for WatchEvent
impl Clone for WatchEvent
Source§fn clone(&self) -> WatchEvent
fn clone(&self) -> WatchEvent
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 moreAuto Trait Implementations§
impl !Freeze for WatchEvent
impl RefUnwindSafe for WatchEvent
impl Send for WatchEvent
impl Sync for WatchEvent
impl Unpin for WatchEvent
impl UnsafeUnpin for WatchEvent
impl UnwindSafe for WatchEvent
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<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>
Wrap the input message
T in a tonic::Request