pub trait ProcessHandle: Send {
// Required methods
fn take_stdout(&mut self) -> Option<Receiver<Vec<u8>>>;
fn take_stderr(&mut self) -> Option<Receiver<Vec<u8>>>;
fn take_stdin(&mut self) -> Option<Sender<Vec<u8>>>;
fn is_pty(&self) -> bool;
fn resize_pty<'life0, 'async_trait>(
&'life0 mut self,
cols: u16,
rows: u16,
) -> Pin<Box<dyn Future<Output = Result<(), IsolatorError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn kill<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), IsolatorError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn wait<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<ExitStatus, IsolatorError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Uniform handle to a running CLI process — host or container.
The handle owns one set of byte channels:
stdout_rx/stderr_rx: lines (or chunks) emitted by the process. For PTY-allocated processes, all output flows throughstdout_rx(stderr is multiplexed by the kernel).stdin_tx: writes from the harness back into the process.Nonefor processes spawned without an input channel.
All channels are tokio mpsc; the isolator background tasks translate platform-specific I/O to these channels.
Required Methods§
Sourcefn take_stdout(&mut self) -> Option<Receiver<Vec<u8>>>
fn take_stdout(&mut self) -> Option<Receiver<Vec<u8>>>
Take ownership of the stdout byte stream. Returns None once
already taken.
Sourcefn take_stderr(&mut self) -> Option<Receiver<Vec<u8>>>
fn take_stderr(&mut self) -> Option<Receiver<Vec<u8>>>
Take ownership of the stderr byte stream.
Sourcefn resize_pty<'life0, 'async_trait>(
&'life0 mut self,
cols: u16,
rows: u16,
) -> Pin<Box<dyn Future<Output = Result<(), IsolatorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn resize_pty<'life0, 'async_trait>(
&'life0 mut self,
cols: u16,
rows: u16,
) -> Pin<Box<dyn Future<Output = Result<(), IsolatorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Resize the PTY window. Errors with Unsupported if not a PTY
process.
Sourcefn kill<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), IsolatorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn kill<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), IsolatorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send SIGTERM (and SIGKILL after grace).
Sourcefn wait<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<ExitStatus, IsolatorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn wait<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<ExitStatus, IsolatorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Wait for the process to exit. Idempotent — repeated calls after exit return the cached status.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".