pub struct Child { /* private fields */ }Expand description
A running program. Dropping it before it exits kills it.
Implementations§
Source§impl Child
impl Child
Sourcepub fn next_event(&mut self) -> Result<Event>
pub fn next_event(&mut self) -> Result<Event>
The next thing the child does, running it until then.
Sourcepub fn write_stdin(&mut self, bytes: &[u8])
pub fn write_stdin(&mut self, bytes: &[u8])
Queues bytes for the child’s stdin, delivered when it next runs.
Sourcepub fn close_stdin(&mut self)
pub fn close_stdin(&mut self)
Ends the child’s stdin: its next read past what is queued gets end of file.
Sourcepub fn wait(self) -> Result<ExitStatus>
pub fn wait(self) -> Result<ExitStatus>
Relays the child’s output to this program’s stdout and its reads to this program’s stdin, until it exits.
Sourcepub fn wait_with_output(self) -> Result<Output>
pub fn wait_with_output(self) -> Result<Output>
Collects the child’s output until it exits. Its reads get whatever was
queued with Child::write_stdin, then end of file.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Child
impl Freeze for Child
impl Move for Child
impl RefUnwindSafe for Child
impl Send for Child
impl Sync for Child
impl Unpin for Child
impl UnsafeUnpin for Child
impl UnwindSafe for Child
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more