Struct etcd_client::WatchOptions
source · pub struct WatchOptions { /* private fields */ }
Expand description
Options for Watch
operation.
Implementations§
source§impl WatchOptions
impl WatchOptions
sourcepub fn with_range(self, end: impl Into<Vec<u8>>) -> Self
pub fn with_range(self, end: impl Into<Vec<u8>>) -> Self
Sets the end of the range [key, end) to watch. If end
is not given,
only the key argument is watched. If end
is equal to ‘\0’, all keys greater than
or equal to the key argument are watched.
sourcepub fn with_from_key(self) -> Self
pub fn with_from_key(self) -> Self
Watches all keys >= key.
sourcepub fn with_prefix(self) -> Self
pub fn with_prefix(self) -> Self
Watches all keys prefixed with key.
sourcepub fn with_all_keys(self) -> Self
pub fn with_all_keys(self) -> Self
Watches all keys.
sourcepub const fn with_start_revision(self, revision: i64) -> Self
pub const fn with_start_revision(self, revision: i64) -> Self
Sets the revision to watch from (inclusive). No start_revision
is “now”.
sourcepub const fn with_progress_notify(self) -> Self
pub const fn with_progress_notify(self) -> Self
progress_notify
is set so that the etcd server will periodically send a WatchResponse
with
no events to the new watcher if there are no recent events. It is useful when clients
wish to recover a disconnected watcher starting from a recent known revision.
The etcd server may decide how often it will send notifications based on current load.
sourcepub fn with_filters(self, filters: impl Into<Vec<WatchFilterType>>) -> Self
pub fn with_filters(self, filters: impl Into<Vec<WatchFilterType>>) -> Self
Filter the events at server side before it sends back to the watcher.
sourcepub const fn with_prev_key(self) -> Self
pub const fn with_prev_key(self) -> Self
If prev_kv
is set, created watcher gets the previous KV before the event happens.
If the previous KV is already compacted, nothing will be returned.
sourcepub const fn with_watch_id(self, watch_id: i64) -> Self
pub const fn with_watch_id(self, watch_id: i64) -> Self
If watch_id
is provided and non-zero, it will be assigned to this watcher.
Since creating a watcher in etcd is not a synchronous operation,
this can be used ensure that ordering is correct when creating multiple
watchers on the same stream. Creating a watcher with an ID already in
use on the stream will cause an error to be returned.
sourcepub const fn with_fragment(self) -> Self
pub const fn with_fragment(self) -> Self
Enables splitting large revisions into multiple watch responses.
Trait Implementations§
source§impl Clone for WatchOptions
impl Clone for WatchOptions
source§fn clone(&self) -> WatchOptions
fn clone(&self) -> WatchOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for WatchOptions
impl Debug for WatchOptions
source§impl Default for WatchOptions
impl Default for WatchOptions
source§fn default() -> WatchOptions
fn default() -> WatchOptions
Auto Trait Implementations§
impl Freeze for WatchOptions
impl RefUnwindSafe for WatchOptions
impl Send for WatchOptions
impl Sync for WatchOptions
impl Unpin for WatchOptions
impl UnwindSafe for WatchOptions
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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