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>;
}Expand description
Platform-neutral handle for the master side of a pseudo-terminal.
Required Methods§
Sourcefn take_writer(&mut self) -> Result<Box<dyn Write + Send>>
fn take_writer(&mut self) -> Result<Box<dyn Write + Send>>
Take the writer used to send input to the PTY.
Sourcefn get_size(&self) -> Result<PtySize>
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.
Sourcefn process_group_leader(&self) -> Option<i32>
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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".