[][src]Struct vault_rs::Client

pub struct Client { /* fields omitted */ }

Vault API Client

Methods

impl Client[src]

pub fn new<S1, S2, S3>(
    vault_address: Option<S1>,
    vault_token: Option<S2>,
    root_ca: Option<S3>,
    revoke_self_on_drop: bool
) -> Result<Self, Error> where
    S1: AsRef<str>,
    S2: AsRef<str>,
    S3: AsRef<str>, 
[src]

Create a new Vault Client.

You can optionally provide a reqwest::Client if you have specific needs like custom root CA certificate or require client authentication

pub fn from_environment<S1, S2, S3>(
    address: Option<S1>,
    token: Option<S2>,
    ca_cert: Option<S3>
) -> Result<Self, Error> where
    S1: AsRef<str>,
    S2: AsRef<str>,
    S3: AsRef<str>, 
[src]

Create a client from environment variables. You can provide alternative sources of the parameters with the optional arguments

The vnrionment variables are:

  • VAULT_ADDR: Vault Address
  • VAULT_TOKEN: Vault Token
  • VAULT_CACERT: Path to the CA Certificate for Vault

pub fn address(&self) -> &str[src]

Returns the Vault address

pub async fn revoke_self<'_>(&'_ self) -> Result<(), Error>[src]

Revoke the Vault token itself

If successful, the Vault Token can no longer be used

Trait Implementations

impl Clone for Client[src]

impl Debug for Client[src]

impl Drop for Client[src]

impl Vault for Client[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]

impl<T> Aws for T where
    T: Vault + Send + Sync
[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, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Mounts for T where
    T: Vault + Send + Sync
[src]

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> Transit for T where
    T: Vault + Send + Sync
[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.