pub enum TreeError<I, C = StrContext> {
Base(TreeErrorBase<I>),
Stack {
base: Box<Self>,
stack: Vec<TreeErrorFrame<I, C>>,
},
Alt(Vec<Self>),
}
Expand description
Trace all error paths, particularly for tests
Variants§
Base(TreeErrorBase<I>)
Initial error that kicked things off
Stack
Fields
§
stack: Vec<TreeErrorFrame<I, C>>
Traces added to the error while walking back up the stack
Traces added to the error while walking back up the stack
Alt(Vec<Self>)
All failed branches of an alt
Implementations§
Trait Implementations§
source§impl<I, C> AddContext<I, C> for TreeError<I, C>
impl<I, C> AddContext<I, C> for TreeError<I, 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<I: Stream + Clone + Debug + Display + Sync + Send + 'static, C: Display + Debug> Error for TreeError<I, C>
impl<I: Stream + Clone + Debug + Display + Sync + Send + 'static, C: Display + Debug> Error for TreeError<I, C>
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl<I, C, E: Error + Send + Sync + 'static> FromExternalError<I, E> for TreeError<I, C>
impl<I, C, E: Error + Send + Sync + 'static> FromExternalError<I, E> for TreeError<I, C>
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, C> ParserError<I> for TreeError<I, C>
impl<I, C> ParserError<I> for TreeError<I, 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 moreAuto Trait Implementations§
impl<I, C> Freeze for TreeError<I, C>where
I: Freeze,
impl<I, C = StrContext> !RefUnwindSafe for TreeError<I, C>
impl<I, C> Send for TreeError<I, C>
impl<I, C> Sync for TreeError<I, C>
impl<I, C> Unpin for TreeError<I, C>
impl<I, C = StrContext> !UnwindSafe for TreeError<I, 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