Skip to main content

capture_group_command_with_cancellation

Function capture_group_command_with_cancellation 

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

Capture a command with caller-selected group cleanup, deadline and cancellation.

Shares capture_group_command’s IO, bounds, exit and cleanup contract. The callback runs before command modification/spawn and during communication; it must return promptly. A true value refuses startup or cleans up the owned group, retaining output and cleanup evidence. An expired absolute deadline refuses before command effects; a live deadline is shared across calls without restarting its allowance. If limits.timeout is also set, the earlier bound applies. Both bounds include callback/spawn time, but synchronous spawning and cleanup may exceed them. None adds no deadline. No signal handler, retry or admission policy is installed. Cleanup and limits remain caller-selected.

§Errors

Invalid limits refuse before the callback or command effects. Cancellation, spawn and communication failures retain the existing typed execution evidence.