pub struct ParserState<'a> {
pub src: &'a str,
pub src_bytes: &'a [u8],
pub end: usize,
pub offset: usize,
pub furthest_offset: usize,
}Fields§
§src: &'a str§src_bytes: &'a [u8]§end: usize§offset: usize§furthest_offset: usizeImplementations§
Source§impl<'a> ParserState<'a>
impl<'a> ParserState<'a>
pub fn new(src: &'a str) -> ParserState<'a>
pub fn is_at_end(&self) -> bool
pub fn get_column_number(&self) -> usize
pub fn get_line_number(&self) -> usize
Sourcepub fn add_expected(&mut self, _label: &'static str)
pub fn add_expected(&mut self, _label: &'static str)
Record an expected label at the current offset. No-op without diagnostics feature.
Sourcepub fn add_suggestion<F>(&mut self, _suggestion: F)
pub fn add_suggestion<F>(&mut self, _suggestion: F)
Record a structured suggestion. No-op without diagnostics feature.
Sourcepub fn add_secondary_span<S>(&mut self, _offset: usize, _label: S)
pub fn add_secondary_span<S>(&mut self, _offset: usize, _label: S)
Record a secondary span annotation. No-op without diagnostics feature.
Trait Implementations§
Source§impl<'a> Clone for ParserState<'a>
impl<'a> Clone for ParserState<'a>
Source§fn clone(&self) -> ParserState<'a>
fn clone(&self) -> ParserState<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for ParserState<'a>
impl<'a> Debug for ParserState<'a>
Source§impl<'a> Default for ParserState<'a>
impl<'a> Default for ParserState<'a>
Source§fn default() -> ParserState<'a>
fn default() -> ParserState<'a>
Returns the “default value” for a type. Read more
Source§impl<'a> From<ParserState<'a>> for Doc<'a>where
'a: 'a,
impl<'a> From<ParserState<'a>> for Doc<'a>where
'a: 'a,
Source§fn from(_self: ParserState<'a>) -> Self
fn from(_self: ParserState<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> Hash for ParserState<'a>
impl<'a> Hash for ParserState<'a>
Source§impl<'a> PartialEq for ParserState<'a>
impl<'a> PartialEq for ParserState<'a>
impl<'a> Eq for ParserState<'a>
impl<'a> StructuralPartialEq for ParserState<'a>
Auto Trait Implementations§
impl<'a> Freeze for ParserState<'a>
impl<'a> RefUnwindSafe for ParserState<'a>
impl<'a> Send for ParserState<'a>
impl<'a> Sync for ParserState<'a>
impl<'a> Unpin for ParserState<'a>
impl<'a> UnsafeUnpin for ParserState<'a>
impl<'a> UnwindSafe for ParserState<'a>
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