pub struct VaultSource { /* private fields */ }Expand description
A Source for the config library that loads configurations from HashiCorp Vault.
This source connects to a HashiCorp Vault server and loads a secret from the version 2 of the KV (Key-Value) engine. The values from the secret are included in the configuration as flat key-value pairs.
§Example
use config_vault::VaultSource;
let vault = VaultSource::new(
"http://vault.example.com:8200".to_string(),
"my-token".to_string(),
"secret".to_string(),
"dev".to_string(),
);Implementations§
Source§impl VaultSource
impl VaultSource
pub fn builder() -> VaultSourceBuilder
Trait Implementations§
Source§impl AsyncSource for VaultSource
impl AsyncSource for VaultSource
Source§fn collect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Map<String, Value>, ConfigError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn collect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Map<String, Value>, ConfigError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Collects all configuration properties available from this source and return
a Map as an async operations.
Source§fn collect_to<'life0, 'life1, 'async_trait>(
&'life0 self,
cache: &'life1 mut Value,
) -> Pin<Box<dyn Future<Output = Result<(), ConfigError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn collect_to<'life0, 'life1, 'async_trait>(
&'life0 self,
cache: &'life1 mut Value,
) -> Pin<Box<dyn Future<Output = Result<(), ConfigError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Collects all configuration properties to a provided cache.
Source§impl Clone for VaultSource
impl Clone for VaultSource
Source§fn clone(&self) -> VaultSource
fn clone(&self) -> VaultSource
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 moreSource§impl Debug for VaultSource
impl Debug for VaultSource
Source§impl PartialEq for VaultSource
impl PartialEq for VaultSource
Source§impl Source for VaultSource
impl Source for VaultSource
fn clone_into_box(&self) -> Box<dyn Source + Send + Sync>
Source§fn collect(&self) -> Result<Map<String, Value>, ConfigError>
fn collect(&self) -> Result<Map<String, Value>, ConfigError>
Collect all configuration properties available from this source into
a
Map.Source§fn collect_to(&self, cache: &mut Value) -> Result<(), ConfigError>
fn collect_to(&self, cache: &mut Value) -> Result<(), ConfigError>
Collects all configuration properties to a provided cache.
impl StructuralPartialEq for VaultSource
Auto Trait Implementations§
impl Freeze for VaultSource
impl RefUnwindSafe for VaultSource
impl Send for VaultSource
impl Sync for VaultSource
impl Unpin for VaultSource
impl UnwindSafe for VaultSource
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