pub struct Environment { /* private fields */ }

Implementations

👎 Deprecated since 0.12.0:

please use ‘Environment::default’ instead

When set and try_parsing is true, then all environment variables will be parsed as Vec<String> instead of String. See [with_list_parse_key] when you want to use Vec<String> in combination with String.

Add a key which should be parsed as a list when collecting Values from the environment. Once list_separator is set, the type for string is Vec<String>. To switch the default type back to type Strings you need to provide the keys which should be Vec<String> using this function.

Note: enabling try_parsing can reduce performance it will try and parse each environment variable 3 times (bool, i64, f64)

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Collect all configuration properties available from this source and return a Map. Read more

Collects all configuration properties to a provided cache.

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

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.