pub struct EnvSource { /* private fields */ }Expand description
Configuration source that loads from environment variables
Implementations§
Source§impl EnvSource
impl EnvSource
Sourcepub fn prefix<S: Into<String>>(self, prefix: S) -> Self
pub fn prefix<S: Into<String>>(self, prefix: S) -> Self
Set a prefix for environment variables (e.g., “APP_”)
Sourcepub fn separator<S: Into<String>>(self, separator: S) -> Self
pub fn separator<S: Into<String>>(self, separator: S) -> Self
Set the separator used to create nested keys (default: “__”)
Sourcepub fn case_sensitive(self, case_sensitive: bool) -> Self
pub fn case_sensitive(self, case_sensitive: bool) -> Self
Set whether environment variable names are case-sensitive
Trait Implementations§
Source§impl ConfigSource for EnvSource
impl ConfigSource for EnvSource
Source§fn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ConfigValue>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ConfigValue>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load configuration from this source
Source§fn supports_watching(&self) -> bool
fn supports_watching(&self) -> bool
Check if this source supports watching for changes
Source§fn start_watching<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Receiver<ConfigValue>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start_watching<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Receiver<ConfigValue>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start watching for changes (if supported)
Auto Trait Implementations§
impl Freeze for EnvSource
impl RefUnwindSafe for EnvSource
impl Send for EnvSource
impl Sync for EnvSource
impl Unpin for EnvSource
impl UnwindSafe for EnvSource
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