pub struct EnvConfigProvider { /* private fields */ }Expand description
Configuration provider that retrieves values from environment variables.
Implementations§
Source§impl EnvConfigProvider
impl EnvConfigProvider
Sourcepub fn new(prefix: &str) -> Self
pub fn new(prefix: &str) -> Self
Create a new environment variable configuration provider with the specified prefix.
Sourcepub fn refresh_cache(&mut self)
pub fn refresh_cache(&mut self)
Refresh the cache of environment variables.
Trait Implementations§
Source§impl ConfigProvider for EnvConfigProvider
impl ConfigProvider for EnvConfigProvider
Source§fn get_raw(&self, key: &str) -> Result<Option<Value>, ConfigError>
fn get_raw(&self, key: &str) -> Result<Option<Value>, ConfigError>
Get a raw configuration value by key.
Returns a JSON Value that can be later deserialized into specific types.
Source§fn has(&self, key: &str) -> bool
fn has(&self, key: &str) -> bool
Check if the configuration provider has a value for the given key.
Source§fn provider_name(&self) -> &str
fn provider_name(&self) -> &str
Get the name of the configuration provider for debugging purposes.
Source§impl Debug for EnvConfigProvider
impl Debug for EnvConfigProvider
Auto Trait Implementations§
impl Freeze for EnvConfigProvider
impl RefUnwindSafe for EnvConfigProvider
impl Send for EnvConfigProvider
impl Sync for EnvConfigProvider
impl Unpin for EnvConfigProvider
impl UnsafeUnpin for EnvConfigProvider
impl UnwindSafe for EnvConfigProvider
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
Source§impl<T> ConfigProviderExt for Twhere
T: ConfigProvider,
impl<T> ConfigProviderExt for Twhere
T: ConfigProvider,
Source§fn get<T: DeserializeOwned>(&self, key: &str) -> Result<Option<T>, ConfigError>
fn get<T: DeserializeOwned>(&self, key: &str) -> Result<Option<T>, ConfigError>
Get a configuration value by key and deserialize it to the specified type.