[−][src]Struct hc_vault::Client
The Client struct represents a single Vault-Connection/Session that can be used for any further requests to vault
Implementations
impl<T: Auth> Client<T>
[src]
pub fn new(conf: Config, auth_opts: T) -> Result<Client<T>, Error>
[src]
This function is used to obtain a new vault session with the given config and auth settings
pub fn get_token(&self) -> String
[src]
A simple method to get the underlying vault session/client token for the current vault session. It is not recommended to use this function, but rather stick to other more integrated parts, like the vault_request function
pub async fn check_session<'_>(&'_ self) -> Result<(), Error>
[src]
This function is used to check if the current session is still valid and if not to renew the session/obtain a new one and update all data related to it
pub async fn vault_request<P: Serialize, '_, '_, '_>(
&'_ self,
method: Method,
path: &'_ str,
body: Option<&'_ P>
) -> Result<Response, Error>
[src]
&'_ self,
method: Method,
path: &'_ str,
body: Option<&'_ P>
) -> Result<Response, Error>
This function is a general way to directly make requests to vault using the current session. This can be used to make custom requests or to make requests to mounts that are not directly covered by this crate.
Auto Trait Implementations
impl<T> RefUnwindSafe for Client<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Client<T> where
T: Send,
T: Send,
impl<T> Sync for Client<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Client<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Client<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,