pub struct MultiConfig { /* private fields */ }Implementations§
Source§impl MultiConfig
Create a configuration that uses the given list of configs to
try and get values. If a value isn’t found, the next config on
the list is consulted. This allows your to create a set of
configs that can override values as needed. For example,
creating a MultiConfig with !vec[environment, instance-config-file, global-config-file, default-values]
would provide something like you’d expect in a 12-factor app.
impl MultiConfig
Create a configuration that uses the given list of configs to
try and get values. If a value isn’t found, the next config on
the list is consulted. This allows your to create a set of
configs that can override values as needed. For example,
creating a MultiConfig with !vec[environment, instance-config-file, global-config-file, default-values]
would provide something like you’d expect in a 12-factor app.
Trait Implementations§
Source§impl Config for MultiConfig
impl Config for MultiConfig
Source§fn int(&self, key: &str) -> i64
fn int(&self, key: &str) -> i64
Get the value as an integer or panics if one isn’t found or
cannot be parsed.
Source§fn float(&self, key: &str) -> f64
fn float(&self, key: &str) -> f64
Get the value as a float or panics if one isn’t found or
cannot be parsed.
Source§fn bool(&self, key: &str) -> bool
fn bool(&self, key: &str) -> bool
Get the value as a bool or panics if one isn’t found or cannot
be parsed. The following case-insensitive values are considered
true: t, true, 1, y, yes. All other values are considered
false.
Source§fn duration(&self, key: &str) -> Duration
fn duration(&self, key: &str) -> Duration
Get the value as a duration or panics if one isn’t found or
can’t be parsed. Thre doesn’t appear to be a parsing function
for a duration, so it attempts to convert to an integer and use
that as the number of seconds.
Source§fn datetime(&self, key: &str) -> DateTime<Utc>
fn datetime(&self, key: &str) -> DateTime<Utc>
Get the value as a duration or panics if one isn’t found or it
can’t be parsed. It uses RFC339 to parse it.
Auto Trait Implementations§
impl Freeze for MultiConfig
impl !RefUnwindSafe for MultiConfig
impl !Send for MultiConfig
impl !Sync for MultiConfig
impl Unpin for MultiConfig
impl !UnwindSafe for MultiConfig
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