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§
Sourcefn http(&self) -> &HTTPClient
fn http(&self) -> &HTTPClient
Returns the underlying HTTP client being used for API calls
Sourcefn middle(&self) -> &EndpointMiddleware
fn middle(&self) -> &EndpointMiddleware
Returns the middleware to be used when executing API calls
Sourcefn settings(&self) -> &VaultClientSettings
fn settings(&self) -> &VaultClientSettings
Returns the settings used to configure this client
Provided Methods§
Sourcefn 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 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
Sourcefn 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 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
Sourcefn revoke<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: '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,
Revokes the current token being used by this client
Sourcefn status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ServerStatus, 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,
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.