BoxCommand
Command builder for running programs in a box.Builder Methods
| Method | Signature | Description |
|---|---|---|
new | fn new(command: impl Into<String>) -> Self | Create command |
arg | fn arg(self, arg: impl Into<String>) -> Self | Add single argument |
args | fn args<I, S>(self, args: I) -> Self | Add multiple arguments |
env | fn env(self, key: impl Into<String>, val: impl Into<String>) -> Self | Set env var |
timeout | fn timeout(self, timeout: Duration) -> Self | Set run timeout |
working_dir | fn working_dir(self, dir: impl Into<String>) -> Self | Set working directory |
tty | fn tty(self, enable: bool) -> Self | Enable pseudo-terminal |
Execution
Handle to a running command.Methods
| Method | Signature | Description |
|---|---|---|
id | fn id(&self) -> &ExecutionId | Get run ID |
stdin | fn stdin(&mut self) -> Option<ExecStdin> | Take stdin stream (once) |
stdout | fn stdout(&mut self) -> Option<ExecStdout> | Take stdout stream (once) |
stderr | fn stderr(&mut self) -> Option<ExecStderr> | Take stderr stream (once) |
wait | async fn wait(&mut self) -> BoxliteResult<ExecResult> | Wait for completion |
kill | async fn kill(&mut self) -> BoxliteResult<()> | Send SIGKILL |
signal | async fn signal(&self, signal: i32) -> BoxliteResult<()> | Send signal |
resize_tty | async fn resize_tty(&self, rows: u32, cols: u32) -> BoxliteResult<()> | Resize PTY |
ExecStdin
Standard input stream (write-only).Example
ExecStdout / ExecStderr
Standard output/error streams (read-only). Implementsfutures::Stream<Item = String>.