vaultrs::client

Trait Client

source
pub trait Client:
    Send
    + Sync
    + Sized {
    // Required methods
    fn http(&self) -> &HTTPClient;
    fn middle(&self) -> &EndpointMiddleware;
    fn settings(&self) -> &VaultClientSettings;
    fn set_token(&mut self, token: &str);

    // Provided methods
    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 { ... }
    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 { ... }
    fn revoke<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    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 { ... }
}
Expand description

The client interface capabale of interacting with API functions

Required Methods§

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

Provided Methods§

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

Object Safety§

This trait is not object safe.

Implementors§