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
Object Safety§
This trait is not object safe.