Trait cnf_lib::environment::IsEnvironment
source · 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§
sourcefn exists(&self) -> bool
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.
sourcefn execute(&self, command: CommandLine) -> Result<Command, Self::Err>
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.