Crate envfury

Source
Expand description

§envfury

A collection of utilities for procedural reading of the process environment variables.

Structs§

Error
Error from reading the env var.

Enums§

MustError
Error while processing a required variable.
OrParseError
Error while processing a variable or parsing it’s default.
ValueError
Error while processing the value.

Functions§

maybe
Get the value of environment variable key and parse it into the type T if variable is set. If the variable is not set - returns None. Returns an error if the value is an invalid unicode or if the value could not be parsed.
must
Get the value of environment variable key and parse it into the type T if variable is set. Returns an error if the value is not set, is an invalid unicode or if the value could not be parsed.
or
Get the value of environment variable key and parse it into the type T if variable is set. If the variable is not set - returns the default argument. Returns an error if the value is an invalid unicode or if the value could not be parsed.
or_else
Get the value of environment variable key and parse it into the type T if variable is set. If the variable is not set - returns the result of calling the default argument. Returns an error if the value is an invalid unicode or if the value could not be parsed.
or_parse
Get the value of environment variable key and parse it into the type T if variable is set. If the variable is not set - returns the result of calling the default and parsing the default argument. Returns an error if the variable value is an invalid unicode or if the value could not be parsed, or if the default could not be parsed.