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 context(&self) -> impl Iterator<Item = &C>
Available on crate feature alloc
only.
pub fn context(&self) -> impl Iterator<Item = &C>
alloc
only.Access context from Parser::context
Trait Implementations§
Source§impl<C, I: Stream> AddContext<I, C> for ContextError<C>
impl<C, I: Stream> AddContext<I, C> for ContextError<C>
Source§fn add_context(
self,
_input: &I,
_token_start: &<I as Stream>::Checkpoint,
context: C,
) -> Self
fn add_context( self, _input: &I, _token_start: &<I as Stream>::Checkpoint, context: C, ) -> Self
Append to an existing error custom data Read more
Source§impl<C: Clone> Clone for ContextError<C>
impl<C: Clone> Clone for ContextError<C>
Source§impl<C: Debug> Debug for ContextError<C>
impl<C: Debug> Debug for ContextError<C>
Source§impl<C> Default for ContextError<C>
impl<C> Default for ContextError<C>
Source§impl Display for ContextError<StrContext>
impl Display for ContextError<StrContext>
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: Error + Send + Sync + 'static> FromExternalError<I, E> for ContextError<C>
Available on crate feature std
only.
impl<C, I, E: Error + Send + Sync + 'static> FromExternalError<I, E> for ContextError<C>
Available on crate feature
std
only.Source§fn from_external_error(_input: &I, _kind: ErrorKind, e: E) -> Self
fn from_external_error(_input: &I, _kind: ErrorKind, e: E) -> Self
Like
ParserError::from_error_kind
but also include an external error.Source§impl<I: Stream, C> ParserError<I> for ContextError<C>
impl<I: Stream, C> ParserError<I> for ContextError<C>
Source§fn from_error_kind(_input: &I, _kind: ErrorKind) -> Self
fn from_error_kind(_input: &I, _kind: ErrorKind) -> Self
Creates an error from the input position and an
ErrorKind
Source§fn append(
self,
_input: &I,
_token_start: &<I as Stream>::Checkpoint,
_kind: ErrorKind,
) -> Self
fn append( self, _input: &I, _token_start: &<I as Stream>::Checkpoint, _kind: ErrorKind, ) -> Self
Like
ParserError::from_error_kind
but merges it with the existing error. Read moreSource§impl<C: PartialEq> PartialEq for ContextError<C>
impl<C: PartialEq> PartialEq for ContextError<C>
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,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 40 bytes