Struct flatzinc::VerboseError
source · [−]pub struct VerboseError<I> {
pub errors: Vec<(I, VerboseErrorKind), Global>,
}
Expand description
This error type accumulates errors and their position when backtracking
through a parse tree. With some post processing (cf examples/json.rs
),
it can be used to display user friendly error messages
Fields
errors: Vec<(I, VerboseErrorKind), Global>
List of errors accumulated by VerboseError
, containing the affected
part of input data, and some context
Trait Implementations
sourceimpl<I> Clone for VerboseError<I> where
I: Clone,
impl<I> Clone for VerboseError<I> where
I: Clone,
sourcepub fn clone(&self) -> VerboseError<I>
pub fn clone(&self) -> VerboseError<I>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<I> ContextError<I> for VerboseError<I>
impl<I> ContextError<I> for VerboseError<I>
sourcepub fn add_context(
input: I,
ctx: &'static str,
other: VerboseError<I>
) -> VerboseError<I>
pub fn add_context(
input: I,
ctx: &'static str,
other: VerboseError<I>
) -> VerboseError<I>
sourceimpl<I> Debug for VerboseError<I> where
I: Debug,
impl<I> Debug for VerboseError<I> where
I: Debug,
sourceimpl<I> Display for VerboseError<I> where
I: Display,
impl<I> Display for VerboseError<I> where
I: Display,
sourceimpl<I> Error for VerboseError<I> where
I: Debug + Display,
impl<I> Error for VerboseError<I> where
I: Debug + Display,
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl<I> ErrorConvert<VerboseError<(I, usize)>> for VerboseError<I>
impl<I> ErrorConvert<VerboseError<(I, usize)>> for VerboseError<I>
sourceimpl<I> ErrorConvert<VerboseError<I>> for VerboseError<(I, usize)>
impl<I> ErrorConvert<VerboseError<I>> for VerboseError<(I, usize)>
sourcepub fn convert(self) -> VerboseError<I>
pub fn convert(self) -> VerboseError<I>
Transform to another error type
sourceimpl<I, E> FromExternalError<I, E> for VerboseError<I>
impl<I, E> FromExternalError<I, E> for VerboseError<I>
sourcepub fn from_external_error(input: I, kind: ErrorKind, _e: E) -> VerboseError<I>
pub fn from_external_error(input: I, kind: ErrorKind, _e: E) -> VerboseError<I>
Create a new error from an input position and an external error
sourceimpl<I> ParseError<I> for VerboseError<I>
impl<I> ParseError<I> for VerboseError<I>
sourcepub fn from_error_kind(input: I, kind: ErrorKind) -> VerboseError<I>
pub fn from_error_kind(input: I, kind: ErrorKind) -> VerboseError<I>
Creates an error from the input position and an ErrorKind
sourcepub fn append(
input: I,
kind: ErrorKind,
other: VerboseError<I>
) -> VerboseError<I>
pub fn append(
input: I,
kind: ErrorKind,
other: VerboseError<I>
) -> VerboseError<I>
sourcepub fn from_char(input: I, c: char) -> VerboseError<I>
pub fn from_char(input: I, c: char) -> VerboseError<I>
Creates an error from an input position and an expected character
sourceimpl<I> PartialEq<VerboseError<I>> for VerboseError<I> where
I: PartialEq<I>,
impl<I> PartialEq<VerboseError<I>> for VerboseError<I> where
I: PartialEq<I>,
sourcepub fn eq(&self, other: &VerboseError<I>) -> bool
pub fn eq(&self, other: &VerboseError<I>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcepub fn ne(&self, other: &VerboseError<I>) -> bool
pub fn ne(&self, other: &VerboseError<I>) -> bool
This method tests for !=
.
impl<I> StructuralPartialEq for VerboseError<I>
Auto Trait Implementations
impl<I> RefUnwindSafe for VerboseError<I> where
I: RefUnwindSafe,
impl<I> Send for VerboseError<I> where
I: Send,
impl<I> Sync for VerboseError<I> where
I: Sync,
impl<I> Unpin for VerboseError<I> where
I: Unpin,
impl<I> UnwindSafe for VerboseError<I> where
I: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more