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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§