pub struct VaultClient { /* private fields */ }Expand description
Vault API client configuration.
Provides methods to interact with Vault’s identity and secrets engines.
Implementations§
Source§impl VaultClient
impl VaultClient
Sourcepub fn new(addr: String, token: String) -> Result<Self>
pub fn new(addr: String, token: String) -> Result<Self>
Create a new Vault client from address and token
Sourcepub fn new_with_skip_verify(
addr: String,
token: String,
skip_verify: bool,
) -> Result<Self>
pub fn new_with_skip_verify( addr: String, token: String, skip_verify: bool, ) -> Result<Self>
Create a new Vault client with option to skip TLS verification
Sourcepub fn from_options(
vault_addr: Option<&str>,
vault_token: Option<&str>,
skip_verify: bool,
) -> Result<Self>
pub fn from_options( vault_addr: Option<&str>, vault_token: Option<&str>, skip_verify: bool, ) -> Result<Self>
Create a client with optional parameters (for CLI)
Sourcepub async fn get<T: DeserializeOwned>(&self, path: &str) -> Result<T>
pub async fn get<T: DeserializeOwned>(&self, path: &str) -> Result<T>
Make a GET request to a Vault API endpoint
Sourcepub async fn get_json(&self, path: &str) -> Result<Value>
pub async fn get_json(&self, path: &str) -> Result<Value>
Make a GET request and return raw JSON Value
Trait Implementations§
Source§impl Clone for VaultClient
impl Clone for VaultClient
Source§fn clone(&self) -> VaultClient
fn clone(&self) -> VaultClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for VaultClient
impl !RefUnwindSafe for VaultClient
impl Send for VaultClient
impl Sync for VaultClient
impl Unpin for VaultClient
impl !UnwindSafe for VaultClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more