pub struct SubprocessHandle { /* private fields */ }Expand description
Handle to a running subprocess with streaming output capture.
Implementations§
Source§impl SubprocessHandle
impl SubprocessHandle
Sourcepub async fn cancel(&mut self) -> Result<()>
pub async fn cancel(&mut self) -> Result<()>
Cancel the subprocess by sending SIGTERM, then SIGKILL if needed.
Sourcepub fn try_recv_stdout(&mut self) -> Option<OutputLine>
pub fn try_recv_stdout(&mut self) -> Option<OutputLine>
Try to receive the next stdout line without blocking.
Sourcepub fn try_recv_stderr(&mut self) -> Option<OutputLine>
pub fn try_recv_stderr(&mut self) -> Option<OutputLine>
Try to receive the next stderr line without blocking.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Returns true if the subprocess is still running.
Sourcepub fn is_timed_out(&self) -> bool
pub fn is_timed_out(&self) -> bool
Check if the subprocess has exceeded its timeout (synchronous check). This does not kill the process; it only checks the elapsed time.
Sourcepub fn try_poll_exit(&mut self) -> bool
pub fn try_poll_exit(&mut self) -> bool
Non-blocking check if the subprocess has exited.
If it has, sets finished and exit_code and returns true.
This allows synchronous tick loops to detect completion.
Sourcepub async fn check_timeout(&mut self) -> bool
pub async fn check_timeout(&mut self) -> bool
Check if the subprocess has exceeded its timeout. Returns true if timed out (and kills the process).
Auto Trait Implementations§
impl !RefUnwindSafe for SubprocessHandle
impl !UnwindSafe for SubprocessHandle
impl Freeze for SubprocessHandle
impl Send for SubprocessHandle
impl Sync for SubprocessHandle
impl Unpin for SubprocessHandle
impl UnsafeUnpin for SubprocessHandle
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> 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> 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>
Converts
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>
Converts
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