pub struct InputParser<C> { /* private fields */ }Expand description
Extensible input parser.
Parses standard key sequences built-in, then dispatches ESC ] sequences
to app-registered OSC handlers.
Implementations§
Source§impl<C: From<KeyPress>> InputParser<C>
impl<C: From<KeyPress>> InputParser<C>
pub fn new(osc_handlers: Vec<OscHandler<C>>) -> Self
Sourcepub fn parse(&self, data: &[u8]) -> Vec<C>
pub fn parse(&self, data: &[u8]) -> Vec<C>
Parse a byte buffer into a sequence of commands.
Protocol:
ESC [ A/B/C/D→ ArrowUp/Down/Right/LeftESC ] ...→ dispatched to app-registered OSC handlers0x09→ Tab,0x0D→ Enter,0x1Balone → Escape,0x7F→ Backspace0x00→ skipped (JS stdin heartbeat)- anything else →
Char(byte)
Auto Trait Implementations§
impl<C> Freeze for InputParser<C>
impl<C> !RefUnwindSafe for InputParser<C>
impl<C> !Send for InputParser<C>
impl<C> !Sync for InputParser<C>
impl<C> Unpin for InputParser<C>
impl<C> UnsafeUnpin for InputParser<C>
impl<C> !UnwindSafe for InputParser<C>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more