Skip to main content

ChildExit

Trait ChildExit 

Source
pub trait ChildExit {
    // Provided method
    fn try_exit_status(&mut self) -> Option<ProcessExitStatus> { ... }
}
Expand description

Reaping/liveness probe for a transport that wraps a child process.

Session::wait/wait_timeout use this to report the child’s real exit status after EOF, rather than ProcessExitStatus::Unknown. Transports that are not backed by a local child process (SSH channels, mock streams) rely on the default implementation, which reports None (status unknowable) and so leaves the session reporting Unknown — exactly the prior behavior.

Provided Methods§

Source

fn try_exit_status(&mut self) -> Option<ProcessExitStatus>

Non-blocking reap.

Returns Some(status) once the child has exited and been reaped (the status is cached, so repeated calls keep returning it), or None while the child is still running or its status cannot be determined.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl ChildExit for AsyncPty

Available on Unix only.