pub trait MasterPty: Downcast + Send {
// Required methods
fn resize(&self, size: PtySize) -> Result<()>;
fn get_size(&self) -> Result<PtySize>;
fn try_clone_reader(&self) -> Result<Box<dyn Read + Send>>;
fn take_writer(&self) -> Result<Box<dyn Write + Send>>;
// Provided methods
fn process_group_leader(&self) -> Option<i32> { ... }
fn as_raw_fd(&self) -> Option<i32> { ... }
fn tty_name(&self) -> Option<PathBuf> { ... }
}Expand description
Represents the master/control end of the pty.
All methods on this trait are cross-platform. Platform-specific
extensions are available via MasterPtyExt (unix only).
Required Methods§
Sourcefn resize(&self, size: PtySize) -> Result<()>
fn resize(&self, size: PtySize) -> Result<()>
Inform the kernel and thus the child process that the window resized.
Provided Methods§
Sourcefn process_group_leader(&self) -> Option<i32>
fn process_group_leader(&self) -> Option<i32>
If applicable, return the local process id of the process group
or session leader. Returns None on non-Unix platforms.
Implementations§
Source§impl dyn MasterPty
impl dyn MasterPty
Sourcepub fn is<__T: MasterPty>(&self) -> bool
pub fn is<__T: MasterPty>(&self) -> bool
Returns true if the trait object wraps an object of type __T.
Sourcepub fn downcast<__T: MasterPty>(self: Box<Self>) -> Result<Box<__T>, Box<Self>>
pub fn downcast<__T: MasterPty>(self: Box<Self>) -> Result<Box<__T>, Box<Self>>
Returns a boxed object from a boxed trait object if the underlying object is of type
__T. Returns the original boxed trait if it isn’t.
Sourcepub fn downcast_rc<__T: MasterPty>(self: Rc<Self>) -> Result<Rc<__T>, Rc<Self>>
pub fn downcast_rc<__T: MasterPty>(self: Rc<Self>) -> Result<Rc<__T>, Rc<Self>>
Returns an Rc-ed object from an Rc-ed trait object if the underlying object is of
type __T. Returns the original Rc-ed trait if it isn’t.
Sourcepub fn downcast_ref<__T: MasterPty>(&self) -> Option<&__T>
pub fn downcast_ref<__T: MasterPty>(&self) -> Option<&__T>
Returns a reference to the object within the trait object if it is of type __T, or
None if it isn’t.
Sourcepub fn downcast_mut<__T: MasterPty>(&mut self) -> Option<&mut __T>
pub fn downcast_mut<__T: MasterPty>(&mut self) -> Option<&mut __T>
Returns a mutable reference to the object within the trait object if it is of type
__T, or None if it isn’t.