pub struct Parser { /* private fields */ }Expand description
The public input parser: bytes in, InputEvents out, with partial-sequence
buffering held across feed calls.
Implementations§
Source§impl Parser
impl Parser
pub fn new() -> Self
Sourcepub fn feed(&mut self, bytes: &[u8]) -> Vec<InputEvent>
pub fn feed(&mut self, bytes: &[u8]) -> Vec<InputEvent>
Feed a chunk of raw terminal bytes; returns the input events decided so
far. Each non-paste segment is decoded through parse_keypress; paste
payloads pass through verbatim. Trailing undecided bytes are buffered for
the next call.
Sourcepub fn has_pending_escape(&self) -> bool
pub fn has_pending_escape(&self) -> bool
Whether a bare/partial escape is buffered (host escape-flush timer hook).
Sourcepub fn flush_pending_escape(&mut self) -> Option<Vec<u8>>
pub fn flush_pending_escape(&mut self) -> Option<Vec<u8>>
Take the buffered escape bytes as literal input, or None if no escape
is pending.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnsafeUnpin 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