Struct etcd_client::GetOptions
source · pub struct GetOptions { /* private fields */ }
Expand description
Options for Get
operation.
Implementations§
source§impl GetOptions
impl GetOptions
sourcepub fn with_range(self, end_key: impl Into<Vec<u8>>) -> Self
pub fn with_range(self, end_key: impl Into<Vec<u8>>) -> Self
Specifies the range of ‘Get’.
Returns the keys in the range [key, end_key).
end_key
must be lexicographically greater than start key.
sourcepub fn with_from_key(self) -> Self
pub fn with_from_key(self) -> Self
Gets all keys >= key.
sourcepub fn with_prefix(self) -> Self
pub fn with_prefix(self) -> Self
Gets all keys prefixed with key.
sourcepub fn with_all_keys(self) -> Self
pub fn with_all_keys(self) -> Self
Gets all keys.
sourcepub const fn with_limit(self, limit: i64) -> Self
pub const fn with_limit(self, limit: i64) -> Self
Limits the number of keys returned for the request. When limit is set to 0, it is treated as no limit.
sourcepub const fn with_revision(self, revision: i64) -> Self
pub const fn with_revision(self, revision: i64) -> Self
The point-in-time of the key-value store to use for the range. If revision is less or equal to zero, the range is over the newest key-value store. If the revision has been compacted, ErrCompacted is returned as a response.
sourcepub fn with_sort(self, target: SortTarget, order: SortOrder) -> Self
pub fn with_sort(self, target: SortTarget, order: SortOrder) -> Self
Sets the order for returned sorted results. It requires ‘with_range’ and/or ‘with_prefix’ to be specified too.
sourcepub const fn with_serializable(self) -> Self
pub const fn with_serializable(self) -> Self
Sets the get request to use serializable member-local reads. Get requests are linearizable by default; linearizable requests have higher latency and lower throughput than serializable requests but reflect the current consensus of the cluster. For better performance, in exchange for possible stale reads, a serializable get request is served locally without needing to reach consensus with other nodes in the cluster.
sourcepub const fn with_keys_only(self) -> Self
pub const fn with_keys_only(self) -> Self
Returns only the keys and not the values.
sourcepub const fn with_count_only(self) -> Self
pub const fn with_count_only(self) -> Self
Returns only the count of the keys in the range.
sourcepub const fn with_min_mod_revision(self, revision: i64) -> Self
pub const fn with_min_mod_revision(self, revision: i64) -> Self
Sets the lower bound for returned key mod revisions; all keys with lesser mod revisions will be filtered away.
sourcepub const fn with_max_mod_revision(self, revision: i64) -> Self
pub const fn with_max_mod_revision(self, revision: i64) -> Self
Sets the upper bound for returned key mod revisions; all keys with greater mod revisions will be filtered away.
sourcepub const fn with_min_create_revision(self, revision: i64) -> Self
pub const fn with_min_create_revision(self, revision: i64) -> Self
Sets the lower bound for returned key create revisions; all keys with lesser create revisions will be filtered away.
sourcepub const fn with_max_create_revision(self, revision: i64) -> Self
pub const fn with_max_create_revision(self, revision: i64) -> Self
max_create_revision
is the upper bound for returned key create revisions; all keys with
greater create revisions will be filtered away.
Trait Implementations§
source§impl Clone for GetOptions
impl Clone for GetOptions
source§fn clone(&self) -> GetOptions
fn clone(&self) -> GetOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for GetOptions
impl Debug for GetOptions
source§impl Default for GetOptions
impl Default for GetOptions
source§fn default() -> GetOptions
fn default() -> GetOptions
Auto Trait Implementations§
impl RefUnwindSafe for GetOptions
impl Send for GetOptions
impl Sync for GetOptions
impl Unpin for GetOptions
impl UnwindSafe for GetOptions
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> 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