pub enum ChildHandle {
Unwrapped {
child: Arc<Mutex<Child>>,
},
Wrapped {
child: Arc<Mutex<WrappedChild>>,
},
}Expand description
Child process handle that can be either wrapped or unwrapped
This enum allows us to support both:
- Legacy tokio::process::Child (no process group)
- WrappedChild with process group support (process-wrap)
Note: Clone implementation creates a new handle that shares the same child but does NOT clone stdout/stderr (those are taken by the first user).
Variants§
Unwrapped
Unwrapped child (legacy, no process group support)
Wrapped
Wrapped child with process group support (via process-wrap)
Fields
§
child: Arc<Mutex<WrappedChild>>The wrapped child
Implementations§
Source§impl ChildHandle
impl ChildHandle
Sourcepub fn stdout(&self) -> Option<&ChildStdout>
pub fn stdout(&self) -> Option<&ChildStdout>
Get stdout reference (only available if not yet taken) Note: This always returns None after cloning because stdout/stderr are not cloned
Sourcepub fn stderr(&self) -> Option<&ChildStderr>
pub fn stderr(&self) -> Option<&ChildStderr>
Get stderr reference (only available if not yet taken) Note: This always returns None after cloning because stdout/stderr are not cloned
Sourcepub async fn wait(&mut self) -> Result<ExitStatus>
pub async fn wait(&mut self) -> Result<ExitStatus>
Wait for the process to exit
Sourcepub fn try_wait(&mut self) -> Result<Option<ExitStatus>>
pub fn try_wait(&mut self) -> Result<Option<ExitStatus>>
Try to wait without blocking
Trait Implementations§
Source§impl Clone for ChildHandle
impl Clone for ChildHandle
Auto Trait Implementations§
impl Freeze for ChildHandle
impl !RefUnwindSafe for ChildHandle
impl Send for ChildHandle
impl Sync for ChildHandle
impl Unpin for ChildHandle
impl !UnwindSafe for ChildHandle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
fn into_option(self) -> Option<T>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request