pub trait Shell: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn execute(
&self,
recipe: &str,
env: &HashMap<String, String>,
dir: &Path,
) -> Result<ShellResult, ShellError>;
fn find_unescaped(&self, input: &str, ch: char) -> Vec<usize>;
fn quote(&self, token: &str) -> String;
}Expand description
Abstraction for executing recipe scripts. Implementations: sh (POSIX /bin/sh), rc (Plan 9 rc), duckscript (future).
Required Methods§
Sourcefn execute(
&self,
recipe: &str,
env: &HashMap<String, String>,
dir: &Path,
) -> Result<ShellResult, ShellError>
fn execute( &self, recipe: &str, env: &HashMap<String, String>, dir: &Path, ) -> Result<ShellResult, ShellError>
Execute a recipe script.
recipe — the full script text (multiline string).
env — environment variables to pass to the shell process.
dir — working directory for the recipe.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".