pub fn subprocess_communicate(
process: &mut Child,
input: &[u8],
stdout_bound: Option<usize>,
stderr_bound: Option<usize>,
return_on_stdout_fill: bool,
) -> (Vec<u8>, Vec<u8>, Result<()>)
Expand description
Sends input to process and returns stdout and stderr up until stdout_bound or stderr_bound are reached If stdout_bound is reached and return_on_stdout_fill is true, the rest of stderr will not be awaited
Conversely, if stdout_bound is reached and return_on_stderr_fill is false Then if insufficient stderr is produced and that file descriptor is not closed by the callee, then the subprocess_communicate will hang until the child produces up to at least the stderr_bound or closes the stderr file descriptor This function may return errors if the stdin, stdout or stderr are unable to be set into nonblocking or if the event loop is unable to be created, otherwise the last return value will be Ok(())