pub struct Checkpoint { /* private fields */ }Expand description
Saved lexer position + nesting depth, restorable via Lexer::restore.
Returned by Lexer::checkpoint. The two fields together capture
everything a typed consumer might mutate while exploring an input
speculatively — the byte cursor and the container-frame stack depth.
Restoring rewinds both, putting the lexer back into the exact state it
was in when the checkpoint was taken.
Used by enum dispatch for representations that must try a variant and
retry another on failure (#[bourne(untagged)]) or that must locate a
tag field before parsing the rest of the object
(#[bourne(tag = "...")]).
Trait Implementations§
Source§impl Clone for Checkpoint
impl Clone for Checkpoint
Source§fn clone(&self) -> Checkpoint
fn clone(&self) -> Checkpoint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Checkpoint
Auto Trait Implementations§
impl Freeze for Checkpoint
impl RefUnwindSafe for Checkpoint
impl Send for Checkpoint
impl Sync for Checkpoint
impl Unpin for Checkpoint
impl UnsafeUnpin for Checkpoint
impl UnwindSafe for Checkpoint
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