Struct ContextError
struct ContextError<C = StrContext> { ... }
Accumulate context while backtracking errors
See the [tutorial][crate::_tutorial::chapter_7#error-adaptation-and-rendering] for an example of how to adapt this to an application error with custom rendering.
Implementations
impl<C> ContextError<C>
fn new() -> SelfCreate an empty error
fn push(self: &mut Self, context: C)Add more context
fn extend<I: IntoIterator<Item = C>>(self: &mut Self, context: I)Add more context
impl Display for ContextError<StrContext>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<C> Default for ContextError<C>
fn default() -> Self
impl<C> ErrorConvert for ContextError<C>
fn convert(self: Self) -> ContextError<C>
impl<C> Freeze for ContextError<C>
impl<C> RefUnwindSafe for ContextError<C>
impl<C> Send for ContextError<C>
impl<C> Sync for ContextError<C>
impl<C> Unpin for ContextError<C>
impl<C> UnsafeUnpin for ContextError<C>
impl<C> UnwindSafe for ContextError<C>
impl<C, I, E: Send + Sync + 'static> FromExternalError for ContextError<C>
fn from_external_error(_input: &I, _e: E) -> Self
impl<C, I: Stream> AddContext for ContextError<C>
fn add_context(self: Self, _input: &I, _token_start: &<I as Stream>::Checkpoint, context: C) -> Self
impl<C: $crate::fmt::Debug> Debug for ContextError<C>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<C: Clone> Clone for ContextError<C>
fn clone(self: &Self) -> Self
impl<C: core::cmp::PartialEq> PartialEq for ContextError<C>
fn eq(self: &Self, other: &Self) -> bool
impl<I: Stream, C> ParserError for ContextError<C>
fn from_input(_input: &I) -> Selffn into_inner(self: Self) -> Result<<Self as >::Inner, Self>
impl<T> Any for ContextError<C>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for ContextError<C>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for ContextError<C>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for ContextError<C>
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for ContextError<C>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into for ContextError<C>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for ContextError<C>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for ContextError<C>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>