pub struct ParseString<'a> {
pub graphemes: &'a Vec<&'a str>,
pub error_log: Vec<(SourceRange, ParseErrorDetail)>,
pub cursor: usize,
pub location: SourceLocation,
}
Expand description
The input type for nom parsers. Instead of holding the actual input string, this struct only holds a reference to that string so that it can be cloned at much lower cost.
Fields§
§graphemes: &'a Vec<&'a str>
Source code
error_log: Vec<(SourceRange, ParseErrorDetail)>
Error report, a list of (error_location, error_context)
cursor: usize
Point at the next grapheme to consume
location: SourceLocation
Location of the grapheme pointed by cursor
Implementations§
Trait Implementations§
Source§impl<'a> Clone for ParseString<'a>
impl<'a> Clone for ParseString<'a>
Source§fn clone(&self) -> ParseString<'a>
fn clone(&self) -> ParseString<'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 ParseString<'a>
impl<'a> Debug for ParseString<'a>
Source§impl<'a> InputLength for ParseString<'a>
Required by nom
impl<'a> InputLength for ParseString<'a>
Required by nom
Source§impl<'a> ParseError<ParseString<'a>> for ParseError<'a>
Required by nom
impl<'a> ParseError<ParseString<'a>> for ParseError<'a>
Required by nom
Source§fn from_error_kind(input: ParseString<'a>, _kind: ErrorKind) -> Self
fn from_error_kind(input: ParseString<'a>, _kind: ErrorKind) -> Self
Not used, unless we have logical error
Source§fn append(_input: ParseString<'a>, _kind: ErrorKind, other: Self) -> Self
fn append(_input: ParseString<'a>, _kind: ErrorKind, other: Self) -> Self
Probably not used
Auto Trait Implementations§
impl<'a> Freeze for ParseString<'a>
impl<'a> RefUnwindSafe for ParseString<'a>
impl<'a> Send for ParseString<'a>
impl<'a> Sync for ParseString<'a>
impl<'a> Unpin for ParseString<'a>
impl<'a> UnwindSafe for ParseString<'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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.