[][src]Struct etcdv3client::EtcdClient

pub struct EtcdClient {
    pub kv: KvClient<Channel>,
    pub watch: WatchClient<Channel>,
    pub lease: LeaseClient<Channel>,
    pub cluster: ClusterClient<Channel>,
    pub maintenance: MaintenanceClient<Channel>,
    pub auth: AuthClient<Channel>,
}

Fields

kv: KvClient<Channel>watch: WatchClient<Channel>lease: LeaseClient<Channel>cluster: ClusterClient<Channel>maintenance: MaintenanceClient<Channel>auth: AuthClient<Channel>

Methods

impl EtcdClient[src]

pub async fn new(
    endpoints: Vec<impl AsRef<str>>,
    auth: Option<(String, String)>
) -> Result<Self, EtcdClientError>
[src]

Create a new EtcdClient

pub async fn get<'_>(
    &'_ mut self,
    key: impl AsRef<[u8]>
) -> Result<Vec<u8>, EtcdClientError>
[src]

get a value with the given key

pub async fn get_string<'_>(
    &'_ mut self,
    key: impl AsRef<[u8]>
) -> Result<String, EtcdClientError>
[src]

get a string with the given key

pub async fn get_prefix<'_>(
    &'_ mut self,
    key: impl AsRef<[u8]>
) -> Result<Vec<KeyValue>, EtcdClientError>
[src]

get key-value paire with prefix

pub async fn get_all<'_>(&'_ mut self) -> Result<Vec<KeyValue>, EtcdClientError>[src]

get all key-value pairs

pub async fn put<'_>(
    &'_ mut self,
    key: impl AsRef<[u8]>,
    value: impl AsRef<[u8]>
) -> Result<(), EtcdClientError>
[src]

put a key-value pair

pub async fn delete<'_>(
    &'_ mut self,
    key: impl AsRef<[u8]>
) -> Result<(), EtcdClientError>
[src]

delete a key-value

pub async fn delete_prefix<'_>(
    &'_ mut self,
    key: impl AsRef<[u8]>
) -> Result<Vec<KeyValue>, EtcdClientError>
[src]

delete key-value pairs with prefix

pub async fn get_token<'_>(
    &'_ mut self,
    username: impl ToString,
    password: impl ToString
) -> Result<String, EtcdClientError>
[src]

get a token with the given username and password

pub async fn watch<'_>(
    &'_ mut self,
    key: impl AsRef<[u8]>
) -> Result<Watcher, EtcdClientError>
[src]

watch a key

pub async fn watch_prefix<'_>(
    &'_ mut self,
    key: impl AsRef<[u8]>
) -> Result<Watcher, EtcdClientError>
[src]

watch a key with prefix

Auto Trait Implementations

Blanket Implementations

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

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

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.

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

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

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

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