Struct consul::Client[][src]

pub struct Client { /* fields omitted */ }

Implementations

impl Client[src]

pub fn new(config: Config) -> Self[src]

Trait Implementations

impl Agent for Client[src]

fn checks(&self) -> Result<HashMap<String, AgentCheck>>[src]

https://www.consul.io/api/agent/check.html#list-checks

fn members(&self, wan: bool) -> Result<AgentMember>[src]

https://www.consul.io/api/agent.html#list-members

fn reload(&self) -> Result<()>[src]

https://www.consul.io/api/agent.html#reload-agent

fn maintenance_mode(&self, enable: bool, reason: Option<&str>) -> Result<()>[src]

https://www.consul.io/api/agent.html#reload-agent

fn join(&self, address: &str, wan: bool) -> Result<()>[src]

https://www.consul.io/api/agent.html#join-agent

fn leave(&self) -> Result<()>[src]

https://www.consul.io/api/agent.html#graceful-leave-and-shutdown

fn force_leave(&self) -> Result<()>[src]

https://www.consul.io/api/agent.html#force-leave-and-shutdown

impl Catalog for Client[src]

fn register(
    &self,
    reg: &CatalogRegistration,
    q: Option<&WriteOptions>
) -> Result<((), WriteMeta)>
[src]

https://www.consul.io/api/catalog.html#register-entity

fn deregister(
    &self,
    dereg: &CatalogDeregistration,
    q: Option<&WriteOptions>
) -> Result<((), WriteMeta)>
[src]

https://www.consul.io/api/catalog.html#deregister-entity

fn datacenters(&self) -> Result<(Vec<String>, QueryMeta)>[src]

https://www.consul.io/api/catalog.html#list-datacenters

fn nodes(&self, q: Option<&QueryOptions>) -> Result<(Vec<Node>, QueryMeta)>[src]

https://www.consul.io/api/catalog.html#list-nodes

fn services(
    &self,
    q: Option<&QueryOptions>
) -> Result<(HashMap<String, Vec<String>>, QueryMeta)>
[src]

impl Clone for Client[src]

fn clone(&self) -> Client[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl ConnectCA for Client[src]

fn ca_roots(&self, q: Option<&QueryOptions>) -> Result<(CARootList, QueryMeta)>[src]

https://www.consul.io/api/connect/ca.html#list-ca-root-certificates

fn ca_get_config(
    &self,
    q: Option<&QueryOptions>
) -> Result<(CAConfig, QueryMeta)>
[src]

https://www.consul.io/api/connect/ca.html#get-ca-configuration

fn ca_set_config(
    &self,
    conf: &CAConfig,
    q: Option<&WriteOptions>
) -> Result<((), WriteMeta)>
[src]

https://www.consul.io/api/connect/ca.html#update-ca-configuration

impl Debug for Client[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Health for Client[src]

fn service(
    &self,
    service: &str,
    tag: Option<&str>,
    passing_only: bool,
    options: Option<&QueryOptions>
) -> Result<(Vec<ServiceEntry>, QueryMeta)>
[src]

impl KV for Client[src]

fn acquire(
    &self,
    pair: &KVPair,
    o: Option<&WriteOptions>
) -> Result<(bool, WriteMeta)>
[src]

fn delete(
    &self,
    key: &str,
    options: Option<&WriteOptions>
) -> Result<(bool, WriteMeta)>
[src]

fn get(
    &self,
    key: &str,
    options: Option<&QueryOptions>
) -> Result<(Option<KVPair>, QueryMeta)>
[src]

fn list(
    &self,
    prefix: &str,
    o: Option<&QueryOptions>
) -> Result<(Vec<KVPair>, QueryMeta)>
[src]

fn put(
    &self,
    pair: &KVPair,
    o: Option<&WriteOptions>
) -> Result<(bool, WriteMeta)>
[src]

fn release(
    &self,
    pair: &KVPair,
    o: Option<&WriteOptions>
) -> Result<(bool, WriteMeta)>
[src]

impl Session for Client[src]

fn create(
    &self,
    session: &SessionEntry,
    options: Option<&WriteOptions>
) -> Result<(SessionEntry, WriteMeta)>
[src]

fn destroy(
    &self,
    id: &str,
    options: Option<&WriteOptions>
) -> Result<(bool, WriteMeta)>
[src]

fn info(
    &self,
    id: &str,
    options: Option<&QueryOptions>
) -> Result<(Vec<SessionEntry>, QueryMeta)>
[src]

fn list(
    &self,
    options: Option<&QueryOptions>
) -> Result<(Vec<SessionEntry>, QueryMeta)>
[src]

fn node(
    &self,
    node: &str,
    options: Option<&QueryOptions>
) -> Result<(Vec<SessionEntry>, QueryMeta)>
[src]

fn renew(
    &self,
    id: &str,
    options: Option<&WriteOptions>
) -> Result<(Vec<SessionEntry>, WriteMeta)>
[src]

Auto Trait Implementations

impl !RefUnwindSafe for Client

impl Send for Client

impl Sync for Client

impl Unpin for Client

impl !UnwindSafe for Client

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V