Enum command_group::stdlib::ErasedChild
source · 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 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