Skip to main content

EnvCapability

Trait EnvCapability 

Source
pub trait EnvCapability: Clone + Debug {
    // Required methods
    fn new() -> Self;
    fn get(&self, name: &str) -> Result<Option<String>, EnvError>;
}

Required Methods§

Source

fn new() -> Self

Source

fn get(&self, name: &str) -> Result<Option<String>, EnvError>

Read an env var.

Ok(None) means the variable is unset; Err(NotUnicode) means it is set but its value is not valid UTF-8. Callers that treat “missing” and “invalid” the same should collapse both branches explicitly.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§