Skip to main content

run_with_timeout

Function run_with_timeout 

Source
pub fn run_with_timeout(cmd: &mut Command, budget: Duration) -> TimedCommand
Expand description

Spawn cmd in its own process group, wait up to budget, and SIGKILL the process tree if it overruns.

Stdout/stderr are drained on background threads so a chatty child cannot fill the pipe and deadlock (unlike a post-exit read_to_end).