pub struct Parser<const OSC_RAW_BUF_SIZE: usize = MAX_OSC_RAW> { /* private fields */ }
Expand description
Parser for raw VTE protocol which delegates actions to a Perform
Generic over the value for the size of the raw Operating System Command
buffer. Only used when the std
feature is not enabled.
Implementations§
Source§impl<const OSC_RAW_BUF_SIZE: usize> Parser<OSC_RAW_BUF_SIZE>
impl<const OSC_RAW_BUF_SIZE: usize> Parser<OSC_RAW_BUF_SIZE>
Sourcepub fn advance<P: Perform>(&mut self, performer: &mut P, bytes: &[u8])
pub fn advance<P: Perform>(&mut self, performer: &mut P, bytes: &[u8])
Advance the parser state.
Requires a Perform
implementation to handle the triggered actions.
Sourcepub fn advance_until_terminated<P: Perform>(
&mut self,
performer: &mut P,
bytes: &[u8],
) -> usize
pub fn advance_until_terminated<P: Perform>( &mut self, performer: &mut P, bytes: &[u8], ) -> usize
Partially advance the parser state.
This is equivalent to Self::advance
, but stops when
Perform::terminated
is true after reading a byte.
Returns the number of bytes read before termination.
See [Perform::advance
] for more details.
Trait Implementations§
Auto Trait Implementations§
impl<const OSC_RAW_BUF_SIZE: usize> Freeze for Parser<OSC_RAW_BUF_SIZE>
impl<const OSC_RAW_BUF_SIZE: usize> RefUnwindSafe for Parser<OSC_RAW_BUF_SIZE>
impl<const OSC_RAW_BUF_SIZE: usize> Send for Parser<OSC_RAW_BUF_SIZE>
impl<const OSC_RAW_BUF_SIZE: usize> Sync for Parser<OSC_RAW_BUF_SIZE>
impl<const OSC_RAW_BUF_SIZE: usize> Unpin for Parser<OSC_RAW_BUF_SIZE>
impl<const OSC_RAW_BUF_SIZE: usize> UnwindSafe for Parser<OSC_RAW_BUF_SIZE>
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