pub struct Emulator { /* private fields */ }Expand description
A VT100/VT220 terminal emulator that tracks screen state.
Wraps vt100::Parser and exposes the minimal surface needed by the
prediction engine and renderer: feed bytes in, read the current screen
state out, and resize on SIGWINCH.
Implementations§
Source§impl Emulator
impl Emulator
Sourcepub fn new(rows: u16, cols: u16) -> Self
pub fn new(rows: u16, cols: u16) -> Self
Create a new emulator with the given initial terminal dimensions.
Sourcepub fn set_size(&mut self, rows: u16, cols: u16)
pub fn set_size(&mut self, rows: u16, cols: u16)
Resize the emulator’s screen (call on SIGWINCH).
Sourcepub fn parser(&self) -> &Parser
pub fn parser(&self) -> &Parser
Returns a reference to the underlying parser (needed for contents_diff).
Sourcepub fn parser_mut(&mut self) -> &mut Parser
pub fn parser_mut(&mut self) -> &mut Parser
Returns a mutable reference to the underlying parser.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Emulator
impl RefUnwindSafe for Emulator
impl Send for Emulator
impl Sync for Emulator
impl Unpin for Emulator
impl UnsafeUnpin for Emulator
impl UnwindSafe for Emulator
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
Mutably borrows from an owned value. Read more