Struct dinglebit_config::env::Environment [−][src]
pub struct Environment { /* fields omitted */ }
Implementations
impl Environment
[src]
pub fn new(prefix: &str) -> Self
[src]
Create a new environment configuration which will prefix keys with the given prefix and an underscore (e.g. prefix = “foo” => “foo_*”). An empty prefix will not prepend anything.
Getting a value from the environment will try to make the key more environment-variable-like . ‘.’ and ‘/’ are replaced with ‘_’ and everything is upper-cased. If the prefix is ‘foo’, then a get for ‘my.app.secret’ would look for ‘FOO_MY_APP_SECRET’.
Trait Implementations
impl Config for Environment
[src]
fn get(&self, key: &str) -> Option<String>
[src]
Get a value from the environment using the given key. ‘.’ and ‘/’ are replaced with ‘_’ and everything is upper-cased. If the prefix is ‘foo’, then a get for ‘my.app.secret’ would look for ‘FOO_MY_APP_SECRET’.
fn must_get(&self, key: &str) -> String
[src]
fn string(&self, key: &str) -> String
[src]
fn int(&self, key: &str) -> i64
[src]
fn float(&self, key: &str) -> f64
[src]
fn bool(&self, key: &str) -> bool
[src]
fn duration(&self, key: &str) -> Duration
[src]
fn datetime(&self, key: &str) -> DateTime<Utc>
[src]
fn list(&self, key: &str) -> Vec<String>
[src]
fn map(&self, key: &str) -> HashMap<String, String>
[src]
impl Debug for Environment
[src]
impl PartialEq<Environment> for Environment
[src]
fn eq(&self, other: &Environment) -> bool
[src]
fn ne(&self, other: &Environment) -> bool
[src]
impl StructuralPartialEq for Environment
[src]
Auto Trait Implementations
impl RefUnwindSafe for Environment
impl Send for Environment
impl Sync for Environment
impl Unpin for Environment
impl UnwindSafe for Environment
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,
pub 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.
pub 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>,