Skip to main content

ProcessManager

Trait ProcessManager 

Source
pub trait ProcessManager:
    Clone
    + Send
    + 'static {
    type Handle: BackgroundHandle + Clone + Send + 'static;

    // Required method
    fn run_command(
        &mut self,
        ctx: &CommandContext,
        script: &str,
        options: CommandOptions,
    ) -> Result<CommandResult<Self::Handle>>;

    // Provided method
    fn spawn_command(
        &mut self,
        ctx: &CommandContext,
        script: &str,
        options: CommandOptions,
    ) -> Result<CommandResult<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§

Required Methods§

Source

fn run_command( &mut self, ctx: &CommandContext, script: &str, options: CommandOptions, ) -> Result<CommandResult<Self::Handle>>

Provided Methods§

Source

fn spawn_command( &mut self, ctx: &CommandContext, script: &str, options: CommandOptions, ) -> Result<CommandResult<Self::Handle>>

Spawn a command without waiting for completion. Returns a background handle that can be polled or waited on later. The default implementation delegates to run_command with CommandMode::Background.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§