pub trait Shell: Send + Sync {
// Required methods
fn exec(
&self,
command: &str,
cwd: &Path,
timeout: Duration,
) -> Result<Output, String>;
fn describe(&self) -> String;
// Provided methods
fn exec_user(
&self,
command: &str,
cwd: &Path,
timeout: Duration,
) -> Result<Output, String> { ... }
fn exec_host(
&self,
command: &str,
cwd: &Path,
timeout: Duration,
) -> Result<Output, String> { ... }
fn available_binaries(
&self,
cwd: &Path,
candidates: &[&'static str],
) -> Result<Vec<String>, String> { ... }
}Required Methods§
Provided Methods§
Sourcefn exec_user(
&self,
command: &str,
cwd: &Path,
timeout: Duration,
) -> Result<Output, String>
fn exec_user( &self, command: &str, cwd: &Path, timeout: Duration, ) -> Result<Output, String>
Run a command the model issued. Where the executor keeps a persistent session, its
cd and export carry over to the model’s next command, as in a terminal. The default
is exec: a fresh process in cwd.
fn exec_host( &self, command: &str, cwd: &Path, timeout: Duration, ) -> Result<Output, String>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".