pub struct ReplayParser<'input> { /* private fields */ }Expand description
A lightweight parser that replays a pre-collected event stream.
Implementations§
Source§impl<'input> ReplayParser<'input>
impl<'input> ReplayParser<'input>
Sourcepub fn new(events: Vec<(Event<'input>, Span)>, anchor_offset: usize) -> Self
pub fn new(events: Vec<(Event<'input>, Span)>, anchor_offset: usize) -> Self
Create a parser that replays events and starts anchor allocation at anchor_offset.
Sourcepub fn get_anchor_offset(&self) -> usize
pub fn get_anchor_offset(&self) -> usize
Return the next anchor ID that should be assigned after replayed events.
Sourcepub fn set_anchor_offset(&mut self, offset: usize)
pub fn set_anchor_offset(&mut self, offset: usize)
Set the next anchor ID that should be assigned after replayed events.
Trait Implementations§
Source§impl<'input> ParserTrait<'input> for ReplayParser<'input>
impl<'input> ParserTrait<'input> for ReplayParser<'input>
Source§fn peek(&mut self) -> Option<Result<&(Event<'input>, Span), ScanError>>
fn peek(&mut self) -> Option<Result<&(Event<'input>, Span), ScanError>>
Try to load the next event and return it without consuming it from
self.Source§fn next_event(&mut self) -> Option<Result<(Event<'input>, Span), ScanError>>
fn next_event(&mut self) -> Option<Result<(Event<'input>, Span), ScanError>>
Try to load the next event and return it, consuming it from
self.Auto Trait Implementations§
impl<'input> Freeze for ReplayParser<'input>
impl<'input> RefUnwindSafe for ReplayParser<'input>
impl<'input> Send for ReplayParser<'input>
impl<'input> Sync for ReplayParser<'input>
impl<'input> Unpin for ReplayParser<'input>
impl<'input> UnsafeUnpin for ReplayParser<'input>
impl<'input> UnwindSafe for ReplayParser<'input>
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