pub struct Parser { /* private fields */ }Expand description
A parser for terminal output which produces an in-memory representation of the terminal contents.
Implementations§
Source§impl Parser
impl Parser
Sourcepub fn new(rows: u16, cols: u16, scrollback_len: usize) -> Self
pub fn new(rows: u16, cols: u16, scrollback_len: usize) -> Self
Creates a new terminal parser of the given size and with the given amount of scrollback.
Sourcepub fn process(&mut self, bytes: &[u8])
pub fn process(&mut self, bytes: &[u8])
Processes the contents of the given byte string, and updates the in-memory terminal state.
Sourcepub fn process_cb(&mut self, bytes: &[u8], callbacks: &mut impl Callbacks)
pub fn process_cb(&mut self, bytes: &[u8], callbacks: &mut impl Callbacks)
Processes the contents of the given byte string, and updates the
in-memory terminal state. Calls methods on the given Callbacks
object when relevant escape sequences are seen.
Sourcepub fn screen(&self) -> &Screen
pub fn screen(&self) -> &Screen
Returns a reference to a Screen object containing the terminal
state.
Sourcepub fn screen_mut(&mut self) -> &mut Screen
pub fn screen_mut(&mut self) -> &mut Screen
Returns a mutable reference to a Screen object containing the
terminal state.
Trait Implementations§
Source§impl Write for Parser
impl Write for Parser
Source§fn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
Writes a buffer into this writer, returning how many bytes were written. Read more
Source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flushes this output stream, ensuring that all intermediately buffered
contents reach their destination. Read more
Source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector)1.0.0 · Source§fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more
Source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
🔬This is a nightly-only experimental API. (
write_all_vectored)Attempts to write multiple buffers into this writer. Read more
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnwindSafe for Parser
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