Skip to main content

PtyMaster

Trait PtyMaster 

Source
pub trait PtyMaster: Send + 'static {
    // Required methods
    fn try_clone_reader(&mut self) -> Result<Box<dyn Read + Send>, Error>;
    fn take_writer(&mut self) -> Result<Box<dyn Write + Send>, Error>;
    fn resize(&self, size: PtySize) -> Result<(), Error>;
    fn get_size(&self) -> Result<PtySize, Error>;

    // Provided methods
    fn process_group_leader(&self) -> Option<i32> { ... }
    fn as_raw_fd(&self) -> Option<i32> { ... }
    fn interrupt_target(&self) -> Result<PtyInterruptTarget, Error> { ... }
    fn kill_process_group(&self) -> Result<(), Error> { ... }
    fn preferred_pid(&self, child: &(dyn PtyChild + 'static)) -> Option<u32> { ... }
}
Expand description

Platform-neutral handle for the master side of a pseudo-terminal.

Required Methods§

Source

fn try_clone_reader(&mut self) -> Result<Box<dyn Read + Send>, Error>

Source

fn take_writer(&mut self) -> Result<Box<dyn Write + Send>, Error>

Source

fn resize(&self, size: PtySize) -> Result<(), Error>

Source

fn get_size(&self) -> Result<PtySize, Error>

Provided Methods§

Source

fn process_group_leader(&self) -> Option<i32>

👎Deprecated:

use facade PTY control operations; removal planned for 5.0

Legacy Unix process-group accessor retained for source compatibility.

Platform mechanics do not consume this value; use facade operations for control. This method will be removed in the next major release.

Source

fn as_raw_fd(&self) -> Option<i32>

👎Deprecated:

use facade PTY operations; removal planned for 5.0

Legacy Unix descriptor accessor retained for source compatibility.

The primitive representation avoids a host-native type in the neutral signature, and shared callers must not use it for platform mechanics.

Source

fn interrupt_target(&self) -> Result<PtyInterruptTarget, Error>

Prepare an owned interrupt operation using the selected host’s PTY mechanics.

Source

fn kill_process_group(&self) -> Result<(), Error>

Kill the selected host’s PTY process group, when one exists.

Source

fn preferred_pid(&self, child: &(dyn PtyChild + 'static)) -> Option<u32>

Select the externally meaningful PID for this PTY.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§