Struct dinglebit_config::simple::Simple
source · [−]pub struct Simple { /* private fields */ }
Implementations
sourceimpl Simple
impl Simple
sourcepub fn from_str(s: &str) -> Result<Self, Error>
pub fn from_str(s: &str) -> Result<Self, Error>
Create a new configuration from the given string. This is an
extremely simple configuration format. It expects key/value
pairs separated by an equal sign. Whitespace is trimmed from
the line as well as each key/value. Lines that begin with #
are considered a comment and empty lines are ignored. Thre is
no hierarchy or anything. If you want to provide some
yourself, you can use dot-notation. For example:
# i am a comment
mongo.uri = mongodb://localhost/
mongo.db = test
Trait Implementations
sourceimpl Config for Simple
impl Config for Simple
sourcefn 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. Read more
sourcefn 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. Read more
sourcefn 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. Read more
sourcefn 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. Read more
sourcefn 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. Read more
impl StructuralPartialEq for Simple
Auto Trait Implementations
impl RefUnwindSafe for Simple
impl Send for Simple
impl Sync for Simple
impl Unpin for Simple
impl UnwindSafe for Simple
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more