[][src]Struct hc_vault::Client

pub struct Client<T: Auth> { /* fields omitted */ }

The Client struct represents a single Vault-Connection/Session that can be used for any further requests to vault

Implementations

impl<T: Auth> Client<T>[src]

pub fn new(conf: Config, auth_opts: T) -> Result<Client<T>, Error>[src]

This function is used to obtain a new vault session with the given config and auth settings

pub fn get_token(&self) -> String[src]

A simple method to get the underlying vault session/client token for the current vault session. It is not recommended to use this function, but rather stick to other more integrated parts, like the vault_request function

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

This function is used to check if the current session is still valid and if not to renew the session/obtain a new one and update all data related to it

pub async fn vault_request<P: Serialize, '_, '_, '_>(
    &'_ self,
    method: Method,
    path: &'_ str,
    body: Option<&'_ P>
) -> Result<Response, Error>
[src]

This function is a general way to directly make requests to vault using the current session. This can be used to make custom requests or to make requests to mounts that are not directly covered by this crate.

Auto Trait Implementations

impl<T> RefUnwindSafe for Client<T> where
    T: RefUnwindSafe
[src]

impl<T> Send for Client<T> where
    T: Send
[src]

impl<T> Sync for Client<T> where
    T: Sync
[src]

impl<T> Unpin for Client<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for Client<T> where
    T: UnwindSafe
[src]

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, 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.