pub struct ParseError<'a> {
pub cause_range: SourceRange,
pub remaining_input: ParseString<'a>,
pub error_detail: ParseErrorDetail,
}
Expand description
The error type for the nom parser, which handles full error context (location + detail) and ownership of the input ParseString.
Eventually error context will be logged and ownership will be moved out.
Fields§
§cause_range: SourceRange
Cause range is defined as [start, end), where start
points at the first
character that’s catched by a label, and end
points at the next
character of the character that didn’t match.
Example: index: 1234567 input: abcdefg error: ~~~^ range: | | [2, 5)
remaining_input: ParseString<'a>
Hold ownership to the input ParseString
error_detail: ParseErrorDetail
Detailed information about this error
Implementations§
Source§impl<'a> ParseError<'a>
impl<'a> ParseError<'a>
Sourcepub fn new(input: ParseString<'a>, msg: &'static str) -> Self
pub fn new(input: ParseString<'a>, msg: &'static str) -> Self
Create a new error at current location of the input, with given message and empty annotations. Ownership of the input is also passed into this error object.
Trait Implementations§
Source§impl<'a> Clone for ParseError<'a>
impl<'a> Clone for ParseError<'a>
Source§fn clone(&self) -> ParseError<'a>
fn clone(&self) -> ParseError<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'a> Debug for ParseError<'a>
impl<'a> Debug for ParseError<'a>
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 ParseError<'a>
impl<'a> RefUnwindSafe for ParseError<'a>
impl<'a> Send for ParseError<'a>
impl<'a> Sync for ParseError<'a>
impl<'a> Unpin for ParseError<'a>
impl<'a> UnwindSafe for ParseError<'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
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>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.