pub struct ReadKeyRequest<'a> {
pub key: &'a str,
pub namespace: &'a str,
pub datacenter: &'a str,
pub recurse: bool,
pub separator: &'a str,
pub consistency: ConsistencyMode,
pub index: Option<u64>,
pub wait: Duration,
}Expand description
Represents a request to read a key from Consul’s Key Value store.
Fields§
§key: &'a strSpecifies the path of the key to read.
namespace: &'a strSpecifies the namespace to query. If not provided, the namespace will be inferred from the request’s ACL token, or will default to the default namespace. For recursive lookups, the namespace may be specified as ‘*’ and then results will be returned for all namespaces. Added in Consul 1.7.0.
datacenter: &'a strSpecifies the datacenter to query. This will default to the datacenter of the agent being queried.
recurse: boolSpecifies if the lookup should be recursive and key treated as a prefix instead of a literal match.
separator: &'a strSpecifies the string to use as a separator for recursive key lookups. This option is only used when paired with the keys parameter to limit the prefix of keys returned, only up to the given separator.
consistency: ConsistencyModeThe consistency mode for reads. See also ConsistencyMode
index: Option<u64>Endpoints that support blocking queries return an HTTP header named X-Consul-Index. This is a unique identifier representing the current state of the requested resource. On subsequent requests for this resource, the client can set the index query string parameter to the value of X-Consul-Index, indicating that the client wishes to wait for any changes subsequent to that index.
wait: DurationThe time to wait for watching a lock in a blocking fashion.
Implementations§
Source§impl<'a> ReadKeyRequest<'a>
impl<'a> ReadKeyRequest<'a>
Sourcepub fn builder() -> ReadKeyRequestBuilder<'a>
pub fn builder() -> ReadKeyRequestBuilder<'a>
Create an instance of ReadKeyRequest using the builder syntax
Trait Implementations§
Source§impl<'a> Clone for ReadKeyRequest<'a>
impl<'a> Clone for ReadKeyRequest<'a>
Source§fn clone(&self) -> ReadKeyRequest<'a>
fn clone(&self) -> ReadKeyRequest<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more