Skip to main content

Resolver

Trait Resolver 

Source
pub trait Resolver {
    // Required methods
    fn expand(&self, name: &str) -> String;
    fn all(&self) -> HashMap<String, String>;
    fn lookup(&self, name: &str) -> Option<String>;
}
Expand description

Resolves variable names to string values. Immutable after construction and safe for concurrent use, once the eventual implementation lands (the Go original documents this contract on the Resolver interface).

Required Methods§

Source

fn expand(&self, name: &str) -> String

An os.Expand-compatible callback: returns the resolved value for name, or “” when the name is neither known nor set in the environment.

Source

fn all(&self) -> HashMap<String, String>

Every predefined variable plus all user-defined static variables. Does not include the (unbounded) environment.

Source

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

The resolved value for name and whether name is known.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§