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>>;
    fn take_writer(&mut self) -> Result<Box<dyn Write + Send>>;
    fn resize(&self, size: PtySize) -> Result<()>;
    fn get_size(&self) -> Result<PtySize>;
    fn process_group_leader(&self) -> Option<i32>;
    fn as_raw_fd(&self) -> Option<RawFd>;
}
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>>

Clone a reader for PTY output.

Source

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

Take the writer used to send input to the PTY.

Source

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

Resize the PTY to the requested dimensions.

Source

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

Return the current PTY dimensions. On Windows the value is the last size passed to resize (or the initial openpty size); ConPTY exposes no live query API. Restored in 4.0.1 for downstream parity with portable-pty’s MasterPty::get_size.

Source

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

On Unix returns the foreground process group leader of the PTY (used by tools like tcsetpgrp checks). Always returns None on Windows where the concept doesn’t exist.

Source

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

Return the Unix PTY master descriptor for bounded control writes.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§