pub trait PtyChild: Send + Sync {
// Required methods
fn pid(&self) -> u32;
fn is_running(&self) -> bool;
fn wait(
&mut self,
) -> Pin<Box<dyn Future<Output = Result<ExitStatus>> + Send + '_>>;
fn try_wait(&mut self) -> Result<Option<ExitStatus>>;
fn signal(&self, signal: PtySignal) -> Result<()>;
fn kill(&mut self) -> Result<()>;
}Expand description
Handle for a child process spawned in a PTY.
This trait provides methods for monitoring and controlling the child
process. It’s separate from PtyMaster to allow independent lifetime
management of the PTY and the process.
Required Methods§
Sourcefn is_running(&self) -> bool
fn is_running(&self) -> bool
Check if the child process is still running.
Sourcefn wait(
&mut self,
) -> Pin<Box<dyn Future<Output = Result<ExitStatus>> + Send + '_>>
fn wait( &mut self, ) -> Pin<Box<dyn Future<Output = Result<ExitStatus>> + Send + '_>>
Wait for the child process to exit.
Returns the exit status when the process terminates.
Sourcefn try_wait(&mut self) -> Result<Option<ExitStatus>>
fn try_wait(&mut self) -> Result<Option<ExitStatus>>
Try to get the exit status without blocking.
Returns None if the process is still running.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".