pub struct Config { /* private fields */ }Expand description
Key-value configuration container.
Implementations§
Source§impl Config
impl Config
Sourcepub fn get_or(&self, key: &str, default: &str) -> String
pub fn get_or(&self, key: &str, default: &str) -> String
Returns the value for key, or default if absent.
Sourcepub fn get_f64(&self, key: &str) -> Option<f64>
pub fn get_f64(&self, key: &str) -> Option<f64>
Parses the value as f64, or None if absent or invalid.
Sourcepub fn get_usize(&self, key: &str) -> Option<usize>
pub fn get_usize(&self, key: &str) -> Option<usize>
Parses the value as usize, or None if absent or invalid.
Sourcepub fn get_bool(&self, key: &str) -> Option<bool>
pub fn get_bool(&self, key: &str) -> Option<bool>
Parses the value as bool, or None if absent or invalid.
Sourcepub fn from_env_prefix(prefix: &str) -> Config
pub fn from_env_prefix(prefix: &str) -> Config
Builds a configuration from environment variables starting with prefix.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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