pub struct PlatformStdChild { /* private fields */ }Expand description
A synchronously launched child whose exit is observed by polling.
Implementations§
Source§impl PlatformStdChild
impl PlatformStdChild
Sourcepub fn from_std(child: Child, own_process_group: bool) -> Self
pub fn from_std(child: Child, own_process_group: bool) -> Self
Adopt a standard child. own_process_group records whether it was
launched as the leader of its own process group.
Sourcepub fn from_exact_trace(child: TracedChild, own_process_group: bool) -> Self
pub fn from_exact_trace(child: TracedChild, own_process_group: bool) -> Self
Adopt an exact-trace child; its tracer remains the sole reaper.
Sourcepub fn is_exact_trace(&self) -> bool
pub fn is_exact_trace(&self) -> bool
Whether the child is reaped by an exact-trace tracer.
Sourcepub fn std_child(&self) -> Option<&Child>
pub fn std_child(&self) -> Option<&Child>
The standard child handle, for post-spawn containment such as Job
Object assignment. None for exact-trace children.
Sourcepub fn attach_job(&mut self, job: WindowsJobHandle)
pub fn attach_job(&mut self, job: WindowsJobHandle)
Keep the per-spawn Job Object alive exactly as long as this child.
Sourcepub fn try_wait_code(&mut self) -> Result<Option<i32>>
pub fn try_wait_code(&mut self) -> Result<Option<i32>>
Non-blocking exit check. Ok(None) while the child is running.
Sourcepub fn wait_code(&mut self) -> Result<i32>
pub fn wait_code(&mut self) -> Result<i32>
Blocking wait for the exit code.
An exact-trace child is waited by polling its tracer’s published
state. This parks the calling thread, so it must never run on an
actor-runtime worker; the runtime observes exit with
Self::try_wait_code instead.
Sourcepub fn kill_group_or_child(&mut self) -> Result<()>
pub fn kill_group_or_child(&mut self) -> Result<()>
Hard-kill the child’s own process group when it leads one and the host can signal groups, otherwise the direct child. Never reaps.
pub fn take_stdin(&mut self) -> Option<ChildStdin>
pub fn take_stdout(&mut self) -> Option<ChildStdout>
pub fn take_stderr(&mut self) -> Option<ChildStderr>
Sourcepub fn prepare_capture(
&mut self,
cancellation: &CaptureCancellation,
) -> Result<PlatformCaptureReaders>
pub fn prepare_capture( &mut self, cancellation: &CaptureCancellation, ) -> Result<PlatformCaptureReaders>
Take both piped output streams and make them cancellable through
cancellation (see cancel_capture_reader). The caller keeps sole
ownership of the cancellation state, so dropping its last reference
is the reader-teardown signal it always was. A failure leaves no
half-registered reader.
Sourcepub fn discard_after_start_error(self)
pub fn discard_after_start_error(self)
Abandon a child whose launch failed after spawn: kill it and reap it off the calling thread, so the caller’s error path stays bounded.
Auto Trait Implementations§
impl Freeze for PlatformStdChild
impl RefUnwindSafe for PlatformStdChild
impl Send for PlatformStdChild
impl Sync for PlatformStdChild
impl Unpin for PlatformStdChild
impl UnsafeUnpin for PlatformStdChild
impl UnwindSafe for PlatformStdChild
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more