Skip to main content

run_group_command

Function run_group_command 

Source
pub fn run_group_command(
    command: &mut Command,
    limits: OutputLimits,
    cleanup: CleanupPolicy,
    deadline: Option<Instant>,
    cancelled: impl FnMut() -> bool,
) -> Result<CompletedExecution, ToolError>
Expand description

Run one caller-configured command in an owned process group.

Preserves the caller’s stdin/stdout/stderr selection, including inherited progress output and file-backed streams. Only piped output is captured and bounded. Any piped stdin is closed; this entry point sends no input bytes. Group selection is replaced with a new owned group. This shares capture_group_command_with_cancellation’s pre-spawn validation, cancellation, absolute/relative deadlines and typed cleanup evidence. The caller selects budgets, cleanup and cancellation; None adds no deadline. Ordinary nonzero/signalled exits return CompletedExecution; callers choose CompletedExecution::require_success. There is no admission or retry.

§Errors

Invalid limits, initial cancellation and expired deadlines refuse before modifying/spawning the command. Later failures clean up the owned group.