[][src]Trait envopt::EnvOpt

pub trait EnvOpt {
    fn validate() -> Result<(), Vec<String>>;
fn value(&self) -> Result<String, String>; fn validate_or_exit() { ... }
fn value_or_exit(&self) -> String { ... } }

A struct that is converted from environment variables.

Required methods

fn validate() -> Result<(), Vec<String>>

Validate all configured environment variables.

Variants without a default cause an error.

fn value(&self) -> Result<String, String>

Get the value for a variant.

If it is missing the default value is returend. If no default is defined an error is returned.

Loading content...

Provided methods

fn validate_or_exit()

Validate all configured environment variables.

If variants without a default are missing exit.

fn value_or_exit(&self) -> String

Get the value for a variant.

If it is missing the default value is returend. If no default is defined exit.

Loading content...

Implementors

Loading content...