pub trait CommandRunner: Send + Sync {
// Required method
fn run(
&self,
request: CommandRequest,
cancel: CancellationToken,
) -> impl Future<Output = Result<CommandResult, ExecError>> + Send;
}Expand description
Trait for running commands. Implementations must be Send + Sync for use across async tasks.
Required Methods§
Sourcefn run(
&self,
request: CommandRequest,
cancel: CancellationToken,
) -> impl Future<Output = Result<CommandResult, ExecError>> + Send
fn run( &self, request: CommandRequest, cancel: CancellationToken, ) -> impl Future<Output = Result<CommandResult, ExecError>> + Send
Execute a command to completion, streaming output as it arrives.
The runner should:
- Transition the command through CmdQueued → CmdStarted → CmdStreaming → terminal.
- Capture stdout/stderr as StreamChunks.
- Respect the cancellation token for graceful shutdown.
- Apply timeout if configured.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.