Skip to main content

ValueSource

Trait ValueSource 

Source
pub trait ValueSource: Send + Sync {
    // Required method
    fn env(&self, name: &str) -> Option<String>;

    // Provided methods
    fn command(&self, _command: &str, _cached: bool) -> Option<String> { ... }
    fn now_unix_seconds(&self) -> i64 { ... }
}
Expand description

Hosts choose which environment values and commands the runtime may access. Commands are disabled by default; the library never reads process env itself.

Required Methods§

Source

fn env(&self, name: &str) -> Option<String>

Provided Methods§

Source

fn command(&self, _command: &str, _cached: bool) -> Option<String>

Source

fn now_unix_seconds(&self) -> i64

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl ValueSource for BTreeMap<String, String>

Source§

fn env(&self, name: &str) -> Option<String>

Implementors§