Struct async_consul::common::QueryOptions[][src]

pub struct QueryOptions {
    pub namespace: Option<String>,
    pub datacenter: Option<String>,
    pub token: Option<String>,
    pub consistency: Option<Consistency>,
    pub blocking: Option<Blocking>,
    pub blocking_timeout: Option<Duration>,
    pub use_cache: bool,
    pub cache_max_age: Option<Duration>,
    pub cache_stale_if_error: Option<Duration>,
    pub near: Option<String>,
    pub node_meta: Option<HashMap<String, String>>,
    pub tag: Option<String>,
    pub filtering: Option<String>,
    pub relay_factor: Option<u8>,
    pub local_only: bool,
    pub connect: bool,
    pub timeout: Option<Duration>,
}

Options specific to query operations.

Fields

namespace: Option<String>

Namespace to execute this operation against.

NOTE: Namespaces are available only in Consul Enterprise.

datacenter: Option<String>

Datacenter to execute this operation against.

By default, operations will execute against whichever datacenter is configured at the endpoint you connect to, whether you're connected directly to a Consul cluster or to an agent.

token: Option<String>

Token to use for this operation.

By default, operations will use the agent's default token if talking to an agent, but will not use a token if talking directly to a Consul cluster.

consistency: Option<Consistency>

Consistency level for this operation.

blocking: Option<Blocking>

Blocking configuration for this operation.

blocking_timeout: Option<Duration>

Blocking timeout.

Only used if blocking is set. This should be set lower than the overall timeout in order to ensure that Consul hasa chance to complete the request and send back results.

If blocking is configured, and timeout is set, but blocking_timeout is not set, then a timeout will be applied to the request overall, and callers may receive a timeout error rather than a successful response from the server.

use_cache: bool

Asks the agent to cache results locally.

Users can refer to the Consul API documentation, [https://www.consul.io/api/features/caching.html], for more information on caching.

cache_max_age: Option<Duration>

Controls how old of a cached response this operation will accept from the agent.

If there is a cached response older than this, the agent treats it as a miss and will attempt to fetch the latest value. If that fetch fails, the error is returned.

For clients that wish to utilize a stale value in the case of an underlying error, they can set [cache_stale_if_error] to specify how old of a value they are willing to accept.

This value is ignored if the endpoint supports background refresh caching.

cache_stale_if_error: Option<Duration>

Controls how old of a cached response this operation will accept from the agent, but only if attempt to refresh the value has failed.

This value is ignored if the endpoint supports background refresh caching.

near: Option<String>

Sorting based on network latency.

Should be the name of a node, which will sort of the results in order of lowest to highest latency from the given node to each node in the results.

Optionally, _agent can be specified to sort the results based on their latency to the agent.

node_meta: Option<HashMap<String, String>>

Filter results to nodes that match the specified node metadata values.

tag: Option<String>

Filter results to nodes that have a tag matching the specified tag.

filtering: Option<String>

Filtering reduces network load by filtering results on the server prior to responding.

Users can refer to the Consul API documentation, [https://www.consul.io/api-docs/features/filtering], to read about filtering.

relay_factor: Option<u8>

Used in keyring operations to force responses to be relayed back to the send through N other random nodes. Most be a value from 0 to 5 (inclusive).

local_only: bool

Used in keyring list operations to force the keyring query to only hit local servers i.e. no WAN traffic.

connect: bool

Only include Connect-capable services/nodes in the response.

Currently only affects prepared query operations.

timeout: Option<Duration>

Timeout for this operation overall.

Trait Implementations

impl Clone for QueryOptions[src]

impl Debug for QueryOptions[src]

impl Default for QueryOptions[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.