Skip to main content

ShellBackend

Trait ShellBackend 

Source
pub trait ShellBackend: Send + Sync {
    // Required methods
    fn run(
        &self,
        command: &str,
        stdin_input: Option<&str>,
        timeout_secs: u64,
        idle_timeout_secs: u64,
        cwd: &Path,
    ) -> CmdOutput;
    fn kind(&self) -> &'static str;

    // Provided method
    fn ui_call(
        &self,
        _method: &str,
        _args: &Value,
    ) -> Option<Result<Value, String>> { ... }
}
Expand description

A command execution backend. cwd is the working directory; timeout_secs of 0 means “no explicit total timeout”. idle_timeout_secs of 0 disables idle timeout (currently only enforced by NativeShell, ignored by FastshellBackend).

Required Methods§

Source

fn run( &self, command: &str, stdin_input: Option<&str>, timeout_secs: u64, idle_timeout_secs: u64, cwd: &Path, ) -> CmdOutput

Source

fn kind(&self) -> &'static str

Human-readable backend name (for diagnostics).

Provided Methods§

Source

fn ui_call(&self, _method: &str, _args: &Value) -> Option<Result<Value, String>>

Host Mobile Use (ui.*) call. None means this backend has no host plugin (e.g. NativeShell); Some(Err) is a host-side failure.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§