Struct anyhow_std::process::Child
source · 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
Basic usage:
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 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