Skip to main content

output

Function output 

Source
pub fn output(command: &mut Command, timeout: Duration) -> Result<Output>
Expand description

Like Command::output, but gives up.

A timeout is reported as io::ErrorKind::TimedOut, so callers that already handle a failed spawn need no new branch: not answering and not starting are the same problem from their side.

The child is killed on timeout rather than left running, because the usual reason to time out is that it is stuck, and a pile of stuck hyprctls helps nobody.