Struct databend_common_ast::parser::Error
source · pub struct Error<'a> {
pub span: Range,
pub errors: Vec<ErrorKind>,
pub contexts: Vec<(Range, &'static str)>,
pub backtrace: &'a Backtrace,
}Expand description
This error type accumulates errors and their position when backtracking
through a parse tree. This take a deepest error at alt combinator.
Fields§
§span: RangeThe span of the next token of the last valid one when encountering an error.
errors: Vec<ErrorKind>List of errors tried in various branches that consumed the same (farthest) length of input.
contexts: Vec<(Range, &'static str)>The backtrace stack of the error.
backtrace: &'a BacktraceThe extra backtrace of error in optional branches.
Implementations§
Trait Implementations§
source§impl<'a> ContextError<Input<'a>> for Error<'a>
impl<'a> ContextError<Input<'a>> for Error<'a>
source§impl<'a> ParseError<Input<'a>> for Error<'a>
impl<'a> ParseError<Input<'a>> for Error<'a>
source§fn from_error_kind(i: Input<'a>, _: ErrorKind) -> Self
fn from_error_kind(i: Input<'a>, _: ErrorKind) -> Self
Creates an error from the input position and an ErrorKind
source§fn append(_: Input<'a>, _: ErrorKind, other: Self) -> Self
fn append(_: Input<'a>, _: ErrorKind, other: Self) -> Self
Combines an existing error with a new one created from the input
position and an ErrorKind. This is useful when backtracking
through a parse tree, accumulating error context on the way
Auto Trait Implementations§
impl<'a> Freeze for Error<'a>
impl<'a> !RefUnwindSafe for Error<'a>
impl<'a> !Send for Error<'a>
impl<'a> !Sync for Error<'a>
impl<'a> Unpin for Error<'a>
impl<'a> !UnwindSafe for Error<'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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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