Function strict_env::parse_optional[][src]

pub fn parse_optional<T: FromStr>(name: &str) -> Result<Option<T>, Error> where
    T::Err: Into<Box<dyn Error + Send + Sync>>, 

Like parse, but allows the environment variable to be missing or empty.

The parsed object is wrapped in an Option to allow this.

Errors

Returns an error if the requested environment variable contains invalid UTF-8 or has a value that cannot be parsed into the target type.