pub enum ErasedChild {
Grouped(AsyncGroupChild),
Ungrouped(Child),
}
Expand description
Wrapper around a process child, be it grouped or ungrouped.
This is a helper which erases that a tokio::process::Child
is a different type than an
AsyncGroupChild
. It forwards to the corresponding method on the inner type.
Variants§
Implementations§
Source§impl ErasedChild
impl ErasedChild
Sourcepub fn id(&mut self) -> Option<u32>
pub fn id(&mut self) -> Option<u32>
Returns the OS-assigned process (group) identifier.
- Grouped:
AsyncGroupChild::id
- Ungrouped:
Child::id
Sourcepub async fn kill(&mut self) -> Result<()>
pub async fn kill(&mut self) -> Result<()>
Forces the child to exit.
- Grouped:
AsyncGroupChild::kill
- Ungrouped:
Child::kill
Sourcepub fn start_kill(&mut self) -> Result<()>
pub fn start_kill(&mut self) -> Result<()>
Attempts to force the child to exit, but does not wait for the request to take effect.
- Grouped:
AsyncGroupChild::start_kill
- Ungrouped:
Child::start_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:
AsyncGroupChild::try_wait
- Ungrouped:
Child::try_wait
Sourcepub async fn wait(&mut self) -> Result<ExitStatus>
pub async fn wait(&mut self) -> Result<ExitStatus>
Waits for the process to exit, and returns its exit status.
- Grouped:
AsyncGroupChild::wait
- Ungrouped:
Child::wait
Sourcepub async fn wait_with_output(self) -> Result<Output>
pub async fn wait_with_output(self) -> Result<Output>
Waits for the process to exit, and returns its exit status.
- Grouped:
AsyncGroupChild::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