[−][src]Struct manaconf::sources::EnvVarSource
A config value source that fetches values from environment variables
The source can be supplied with a prefix for environment variables
by using with_prefix
.
Environment variable names, are thus then constructed as
PREFIX_COMPONENT_COMPONENT_COMPONENT
If there is no prefix then it's just COMPONENT_COMPONENT_COMPONENT
i.e. If the source has a prefix of MYCONFIG
and you requested a value
with the key database::connection_string
. The environment variable
that is looked up would be MYCONFIG_DATABASE_CONNECTION_STRING
It is worth noting, however, that this scheme may cause conflicts as
the key database::connection_string
and database::connection::string
would result in the same environment variable DATABASE_CONNECTION_STRING
.
Implementations
impl EnvVarSource
[src]
pub fn new() -> Self
[src]
Creates an environment variable source
pub fn with_prefix<T: Into<String>>(prefix: T) -> Self
[src]
Creates an environment source with a given prefix to the environment variables name.
Trait Implementations
impl Source for EnvVarSource
[src]
Auto Trait Implementations
impl RefUnwindSafe for EnvVarSource
impl Send for EnvVarSource
impl Sync for EnvVarSource
impl Unpin for EnvVarSource
impl UnwindSafe for EnvVarSource
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[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.
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>,