pub trait CommandRunner {
// Required method
fn run(
&self,
cmd: &Command,
input: Option<&PipeValue>,
) -> Result<CommandOutput, ExecutionError>;
}Expand description
Port: dispatches a single slash command and returns its output.
Implement this trait to define what each command actually does. The
orchestration engine (Executor) handles &&/||/|/|& semantics,
optional-pipe context accumulation, and redirection; this trait handles
only individual command dispatch.
§Contract
cmd.nameis the normalized, lowercase command name.inputis the pipe value arriving from the left, if any.- Returning
Okwithsuccess: falseis a soft failure — the executor uses it for&&/||branching but does not propagate it as an error. - Returning
Erris a hard failure that aborts execution immediately.