pub struct ContextError<C = StrContext> { /* private fields */ }Expand description
Accumulate context while backtracking errors
Implementations§
Source§impl<C> ContextError<C>
impl<C> ContextError<C>
Sourcepub fn new() -> ContextError<C>
pub fn new() -> ContextError<C>
Create an empty error
Sourcepub fn context(&self) -> impl Iterator<Item = &C>
pub fn context(&self) -> impl Iterator<Item = &C>
Access context from Parser::context
Trait Implementations§
Source§impl<C, I> AddContext<I, C> for ContextError<C>where
I: Stream,
impl<C, I> AddContext<I, C> for ContextError<C>where
I: Stream,
Source§fn add_context(
self,
_input: &I,
_token_start: &<I as Stream>::Checkpoint,
context: C,
) -> ContextError<C>
fn add_context( self, _input: &I, _token_start: &<I as Stream>::Checkpoint, context: C, ) -> ContextError<C>
Append to an existing error custom data Read more
Source§impl<C> Clone for ContextError<C>where
C: Clone,
impl<C> Clone for ContextError<C>where
C: Clone,
Source§fn clone(&self) -> ContextError<C>
fn clone(&self) -> ContextError<C>
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<C> Debug for ContextError<C>where
C: Debug,
impl<C> Debug for ContextError<C>where
C: Debug,
Source§impl<C> Default for ContextError<C>
impl<C> Default for ContextError<C>
Source§fn default() -> ContextError<C>
fn default() -> ContextError<C>
Returns the “default value” for a type. Read more
Source§impl Display for ContextError
impl Display for ContextError
Source§impl<C> ErrorConvert<ContextError<C>> for ContextError<C>
impl<C> ErrorConvert<ContextError<C>> for ContextError<C>
Source§fn convert(self) -> ContextError<C>
fn convert(self) -> ContextError<C>
Transform to another error type
Source§impl<C, I, E> FromExternalError<I, E> for ContextError<C>
Available on crate feature std only.
impl<C, I, E> FromExternalError<I, E> for ContextError<C>
Available on crate feature
std only.Source§fn from_external_error(_input: &I, _kind: ErrorKind, e: E) -> ContextError<C>
fn from_external_error(_input: &I, _kind: ErrorKind, e: E) -> ContextError<C>
Like
ParserError::from_error_kind but also include an external error.Source§impl<I, C> ParserError<I> for ContextError<C>where
I: Stream,
impl<I, C> ParserError<I> for ContextError<C>where
I: Stream,
Source§fn from_error_kind(_input: &I, _kind: ErrorKind) -> ContextError<C>
fn from_error_kind(_input: &I, _kind: ErrorKind) -> ContextError<C>
👎Deprecated since 0.6.26: replaced with
ParserError::from_inputDeprecated, replaced with
ParserError::from_inputSource§fn append(
self,
_input: &I,
_token_start: &<I as Stream>::Checkpoint,
_kind: ErrorKind,
) -> ContextError<C>
fn append( self, _input: &I, _token_start: &<I as Stream>::Checkpoint, _kind: ErrorKind, ) -> ContextError<C>
Like
ParserError::from_error_kind but merges it with the existing error. Read moreSource§fn or(self, other: ContextError<C>) -> ContextError<C>
fn or(self, other: ContextError<C>) -> ContextError<C>
Combines errors from two different parse branches. Read more
Source§fn from_input(input: &I) -> Self
fn from_input(input: &I) -> Self
Creates an error from the input position
Source§impl<C> PartialEq for ContextError<C>where
C: PartialEq,
impl<C> PartialEq for ContextError<C>where
C: PartialEq,
Auto Trait Implementations§
impl<C> Freeze for ContextError<C>
impl<C = StrContext> !RefUnwindSafe for ContextError<C>
impl<C> Send for ContextError<C>where
C: Send,
impl<C> Sync for ContextError<C>where
C: Sync,
impl<C> Unpin for ContextError<C>where
C: Unpin,
impl<C = StrContext> !UnwindSafe for ContextError<C>
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more