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