pub trait ProcessManager: Clone {
type Handle: BackgroundHandle;
// Required methods
fn run(&mut self, ctx: &CommandContext, script: &str) -> Result<()>;
fn run_capture(
&mut self,
ctx: &CommandContext,
script: &str,
) -> Result<Vec<u8>>;
fn spawn_bg(
&mut self,
ctx: &CommandContext,
script: &str,
) -> Result<Self::Handle>;
}Expand description
Abstraction for running shell commands both in the foreground and
background. oxdock-core relies on this trait to decouple the executor
from std::process::Command, which in turn enables Miri-friendly test
doubles.
Required Associated Types§
type Handle: BackgroundHandle
Required Methods§
fn run(&mut self, ctx: &CommandContext, script: &str) -> Result<()>
fn run_capture(&mut self, ctx: &CommandContext, script: &str) -> Result<Vec<u8>>
fn spawn_bg( &mut self, ctx: &CommandContext, script: &str, ) -> Result<Self::Handle>
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.