Skip to main content

SandboxProcess

Trait SandboxProcess 

Source
pub trait SandboxProcess: Send {
    // Required methods
    fn pid(&self) -> Option<u32>;
    fn take_stdout(&mut self) -> Option<ByteStream>;
    fn take_stderr(&mut self) -> Option<ByteStream>;
    fn wait(&mut self) -> BoxFuture<'_, Result<i32>>;
    fn kill(&mut self) -> BoxFuture<'_, Result<()>>;
}
Expand description

A running process started with Sandbox::spawn.

Implementations must make kill idempotent and let wait be called after the output streams were taken.

Required Methods§

Source

fn pid(&self) -> Option<u32>

Process id, when known.

Source

fn take_stdout(&mut self) -> Option<ByteStream>

Takes the standard output stream (once).

Source

fn take_stderr(&mut self) -> Option<ByteStream>

Takes the standard error stream (once).

Source

fn wait(&mut self) -> BoxFuture<'_, Result<i32>>

Waits for exit, returning the exit code.

Source

fn kill(&mut self) -> BoxFuture<'_, Result<()>>

Terminates the process.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§