pub trait SandboxChild {
type Error: Error + 'static;
// Required methods
fn id(&self) -> u32;
fn stdin(&mut self) -> Option<&mut dyn Write>;
fn stdout(&mut self) -> Option<&mut dyn Read>;
fn stderr(&mut self) -> Option<&mut dyn Read>;
fn try_wait(&mut self) -> Result<Option<ExitStatus>, Self::Error>;
fn wait(&mut self) -> Result<ExitStatus, Self::Error>;
fn kill(&mut self) -> Result<(), Self::Error>;
// Provided methods
fn take_stdin(&mut self) -> Option<Box<dyn Write + Send>> { ... }
fn take_stdout(&mut self) -> Option<Box<dyn Read + Send>> { ... }
fn take_stderr(&mut self) -> Option<Box<dyn Read + Send>> { ... }
}Expand description
Common lifecycle operations for one native sandbox instance.
Required Associated Types§
Required Methods§
Sourcefn stdin(&mut self) -> Option<&mut dyn Write>
fn stdin(&mut self) -> Option<&mut dyn Write>
Returns the piped standard input stream, if requested.
Sourcefn stdout(&mut self) -> Option<&mut dyn Read>
fn stdout(&mut self) -> Option<&mut dyn Read>
Returns the piped standard output stream, if requested.
Sourcefn stderr(&mut self) -> Option<&mut dyn Read>
fn stderr(&mut self) -> Option<&mut dyn Read>
Returns the piped standard error stream, if requested.
Sourcefn try_wait(&mut self) -> Result<Option<ExitStatus>, Self::Error>
fn try_wait(&mut self) -> Result<Option<ExitStatus>, Self::Error>
Checks for completion without waiting for the command.
Sourcefn wait(&mut self) -> Result<ExitStatus, Self::Error>
fn wait(&mut self) -> Result<ExitStatus, Self::Error>
Waits for completion while enforcing the prepared timeout policy.
Provided Methods§
Sourcefn take_stdin(&mut self) -> Option<Box<dyn Write + Send>>
fn take_stdin(&mut self) -> Option<Box<dyn Write + Send>>
Takes ownership of the piped standard input stream, when supported.
This is used by adapters that must perform blocking stream I/O without holding the child lifecycle lock. The default keeps existing custom backends source-compatible; such adapters expose no detachable stream through that integration path.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".