vaultrs::client

Struct VaultClient

source
pub struct VaultClient {
    pub http: Client,
    pub middle: EndpointMiddleware,
    pub settings: VaultClientSettings,
}
Expand description

A client which can be used to execute calls against a Vault server.

A vault client is configured using VaultClientSettings and will automatically configure a backing instance of a HTTPClient which is used for executing Endpoints.

Fields§

§http: Client§middle: EndpointMiddleware§settings: VaultClientSettings

Implementations§

Trait Implementations§

source§

impl Client for VaultClient

source§

fn http(&self) -> &HTTPClient

Returns the underlying HTTP client being used for API calls
source§

fn middle(&self) -> &EndpointMiddleware

Returns the middleware to be used when executing API calls
source§

fn settings(&self) -> &VaultClientSettings

Returns the settings used to configure this client
source§

fn set_token(&mut self, token: &str)

Sets the underlying token for this client
source§

fn lookup<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<LookupTokenResponse, ClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Looks up the current token being used by this client
source§

fn renew<'life0, 'life1, 'async_trait>( &'life0 self, increment: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<AuthInfo, ClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Renews the current token being used by this client
source§

fn revoke<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Revokes the current token being used by this client
source§

fn status<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<ServerStatus, ClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the status of the configured Vault server

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

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

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T