pub struct FunChildren { /* private fields */ }
Expand description
Representation of running or exited children processes with output, connected with pipes optionally.
Calling spawn_with_output! macro will return Result<FunChildren>
Implementations§
Source§impl FunChildren
impl FunChildren
Sourcepub fn wait_with_all(&mut self) -> (CmdResult, String, String)
pub fn wait_with_all(&mut self) -> (CmdResult, String, String)
Waits for the children processes to exit completely, returning the command result, stdout content string and stderr content string.
Sourcepub fn wait_with_output(&mut self) -> FunResult
pub fn wait_with_output(&mut self) -> FunResult
Waits for the children processes to exit completely, returning the stdout output.
Sourcepub fn wait_with_raw_output(&mut self, buf: &mut Vec<u8>) -> CmdResult
pub fn wait_with_raw_output(&mut self, buf: &mut Vec<u8>) -> CmdResult
Waits for the children processes to exit completely, and read all bytes from stdout into buf
.
Sourcepub fn wait_with_pipe(
&mut self,
f: &mut dyn FnMut(&mut Box<dyn Read>),
) -> CmdResult
pub fn wait_with_pipe( &mut self, f: &mut dyn FnMut(&mut Box<dyn Read>), ) -> CmdResult
Pipes stdout from the last child in the pipeline to the given function, which runs in the current thread, then waits for all of the children to exit.
If the function returns early, without reading from stdout until the last child exits, then the rest of stdout is automatically read and discarded to allow the child to finish.