pub fn reap_or_kill(
child: &mut Child,
timeout: Duration,
) -> Result<Option<ExitStatus>>Expand description
Wait for an already-spawned child up to timeout, killing and reaping
it if it overruns. Returns Ok(Some(status)) if it exited on its own, or
Ok(None) if it was killed for exceeding the timeout. Either way the
child is reaped, so a fire-and-forget caller can’t leak a zombie or a
runaway process.