pub struct Parser { /* private fields */ }Expand description
Implementations§
Source§impl Parser
impl Parser
Sourcepub fn feed_with<F: FnMut(Event<'_>)>(&mut self, input: &[u8], f: F)
pub fn feed_with<F: FnMut(Event<'_>)>(&mut self, input: &[u8], f: F)
Tokenize input, calling f once per Event, allocating nothing.
Partial sequences are held for the next call. A text run in progress is always delivered before returning, so no input byte is buffered except inside an unfinished escape sequence.
Sourcepub fn feed(&mut self, input: &[u8]) -> Vec<Token>
pub fn feed(&mut self, input: &[u8]) -> Vec<Token>
Feed a chunk of bytes; returns the tokens completed by this chunk.
Any accumulated text run is flushed at the end of the call; partial
escape sequences and partial UTF-8 characters are held for the next.
This is feed_with with the events copied into
owned Tokens; prefer the engine where the allocation matters.
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