pub struct LocalPty { /* private fields */ }Expand description
A program on this machine, on a PTY (ConPTY on Windows), through portable-pty as rs-rich-record’s tapes run theirs.
Implementations§
Source§impl LocalPty
impl LocalPty
pub fn new(command: impl Into<Command>) -> LocalPty
Sourcepub fn backpressure(self, bytes: usize) -> LocalPty
pub fn backpressure(self, bytes: usize) -> LocalPty
Hold at most about bytes of output that has not been
read (one read of the PTY more, at most 64 KiB);
past it, stop reading the program’s output until some is read, so
its writes wait, as they do on a slow terminal. Nothing is dropped,
at any limit (16 MiB’s or more included): memory is bounded by the
limit itself. Without this, output is never waited for: past 16 MiB
unread, the oldest is dropped. For
a reader that may fall behind and must not lose anything, such as a
browser at the end of a network (rs-rich-web).
Trait Implementations§
Source§impl PtyHost for LocalPty
impl PtyHost for LocalPty
Source§fn write(&mut self, bytes: &[u8]) -> Result<()>
fn write(&mut self, bytes: &[u8]) -> Result<()>
Refused with io::ErrorKind::WouldBlock while 1 MiB of input
the program has not read is held (one write more at most), so a
flood of pastes to a program that is not reading costs a bounded
amount of memory. A pane drops what is refused.
Source§fn kill(&mut self) -> Result<()>
fn kill(&mut self) -> Result<()>
Hang up on the program (SIGHUP on Unix, as a terminal closing does; on Windows it ends at once). One still running a second later, such as one that ignores SIGHUP, is killed with SIGKILL, with everything in its process group.
Source§fn start(&mut self, columns: u16, rows: u16) -> Result<()>
fn start(&mut self, columns: u16, rows: u16) -> Result<()>
columns x rows cells. Called once,
when the pane is first laid out.Source§fn resize(&mut self, columns: u16, rows: u16) -> Result<()>
fn resize(&mut self, columns: u16, rows: u16) -> Result<()>
columns x rows cells.Source§fn read(&mut self) -> Vec<u8> ⓘ
fn read(&mut self) -> Vec<u8> ⓘ
Source§fn set_notify(&mut self, notify: Notify)
fn set_notify(&mut self, notify: Notify)
notify whenever output arrives or the program exits. Given
once, before or after start; a host with something
already waiting calls it at once.Source§fn exit_status(&mut self) -> Option<ExitStatus>
fn exit_status(&mut self) -> Option<ExitStatus>
Auto Trait Implementations§
impl !RefUnwindSafe for LocalPty
impl !Sync for LocalPty
impl !UnwindSafe for LocalPty
impl Freeze for LocalPty
impl Send for LocalPty
impl Unpin for LocalPty
impl UnsafeUnpin for LocalPty
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.