pub struct Child {
pub stdin: Option<ChildStdin>,
pub stdout: Option<ChildStdout>,
pub stderr: Option<ChildStderr>,
/* private fields */
}
Expand description
Wrap std::process::Child to provide the command as error context
Fields§
§stdin: Option<ChildStdin>
§stdout: Option<ChildStdout>
§stderr: Option<ChildStderr>
Implementations§
Source§impl Child
impl Child
Sourcepub fn kill(&mut self) -> Result<()>
pub fn kill(&mut self) -> Result<()>
Override std::process::Child::kill with the command as error context
Sourcepub fn wait(&mut self) -> Result<ExitStatus>
pub fn wait(&mut self) -> Result<ExitStatus>
Override std::process::Child::wait with the command as error context
Sourcepub fn try_wait(&mut self) -> Result<Option<ExitStatus>>
pub fn try_wait(&mut self) -> Result<Option<ExitStatus>>
Override std::process::Child::try_wait with the command as error context
Sourcepub fn wait_with_output(self) -> Result<Output>
pub fn wait_with_output(self) -> Result<Output>
Override std::process::Child::wait_with_output with the command as error context
Methods from Deref<Target = Child>§
1.3.0 · Sourcepub fn id(&self) -> u32
pub fn id(&self) -> u32
Returns the OS-assigned process identifier associated with this child.
§Examples
use std::process::Command;
let mut command = Command::new("ls");
if let Ok(child) = command.spawn() {
println!("Child's ID is {}", child.id());
} else {
println!("ls command didn't start");
}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Child
impl RefUnwindSafe for Child
impl Send for Child
impl Sync for Child
impl Unpin 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