pub trait IsEnvironment: Debug + Display {
    type Err;

    // Required methods
    fn exists(&self) -> bool;
    fn execute(&self, command: CommandLine) -> Result<Command, Self::Err>;
}
Expand description

Trait for usable environments.

Required Associated Types§

Required Methods§

source

fn exists(&self) -> bool

Returns true if the given Env is available at all.

We assume the environment Host to be available unconditionally. Other environments, such as toolbx, can only be available when at least the toolbx executable is present, or we are currently inside a toolbx.

source

fn execute(&self, command: CommandLine) -> Result<Command, Self::Err>

Execute a command within this environment

IsProvider implementations should prefer calling output_of() instead of interacting with an Environment instance directly. Refer to output_of() for details.

Implementors§