pub struct Simple { /* private fields */ }

Implementations

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

Similar to from_str except that the given path is used as the contents for the string to parse.

Trait Implementations

Returns the value associated with the given key.

Similar to get but panics if there is no value.

Get the value as a string or panics if one isn’t found.

Get the value as an integer or panics if one isn’t found or cannot be parsed. Read more

Get the value as a float or panics if one isn’t found or cannot be parsed. Read more

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

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

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

Get a list or panics if one isn’t found. The list should be a comma-delimited list surrouned by brackets (e.g. [1, 2, 3] => vec![“1”, “2”, “3”]. Read more

Get a map or panics if one isn’t found. The list should be a comma-delimited list surrouned by braces with key/value pairs associated with => (e.g. {a=>1, b=>2, c=>3} => ((a,1), (b,2), (c,3))). Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.