pub enum ErasedChild {
Grouped(GroupChild),
Ungrouped(Child),
}
Expand description
Wrapper around a process child, be it grouped or ungrouped.
This is a helper which erases that a std::process::Child
is a different type than a
GroupChild
. It forwards to the corresponding method on the inner type.
Variants§
Implementations§
Source§impl ErasedChild
impl ErasedChild
Sourcepub fn id(&mut self) -> u32
pub fn id(&mut self) -> u32
Returns the OS-assigned process (group) identifier.
- Grouped:
GroupChild::id
- Ungrouped:
Child::id
Sourcepub fn kill(&mut self) -> Result<()>
pub fn kill(&mut self) -> Result<()>
Forces the child to exit.
- Grouped:
GroupChild::kill
- Ungrouped:
Child::kill
Sourcepub fn try_wait(&mut self) -> Result<Option<ExitStatus>>
pub fn try_wait(&mut self) -> Result<Option<ExitStatus>>
Attempts to collect the exit status of the child if it has already exited.
- Grouped:
GroupChild::try_wait
- Ungrouped:
Child::try_wait
Sourcepub fn wait(&mut self) -> Result<ExitStatus>
pub fn wait(&mut self) -> Result<ExitStatus>
Waits for the process to exit, and returns its exit status.
- Grouped:
GroupChild::wait
- Ungrouped:
Child::wait
Sourcepub fn wait_with_output(self) -> Result<Output>
pub fn wait_with_output(self) -> Result<Output>
Waits for the process to exit, and returns its exit status.
- Grouped:
GroupChild::wait_with_output
- Ungrouped:
Child::wait_with_output
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ErasedChild
impl RefUnwindSafe for ErasedChild
impl Send for ErasedChild
impl Sync for ErasedChild
impl Unpin for ErasedChild
impl UnwindSafe for ErasedChild
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