pub struct Error { /* private fields */ }
Expand description
An error or collection of errors raised during parsing.
These errors are intended to be reported using ariadne
, but an
implementation of ToString
is provided as an alternative if that is not
possible.
Available on crate feature ariadne
only.
Prints this error to stderr.
Appends the given error to this one.
fn error(&mut self, error: Error) {
if let Some(existing_error) = &mut self.error {
existing_error.add(error);
} else {
self.error = Some(error);
}
}
Consumes self
and other
, returning a new error with the contents of
both.
Performs copy-assignment from
source
.
Read more
Formats the value using the given formatter.
Read more
Formats the value using the given formatter.
Read moresource§Available on crate feature ariadne
only.
Converts to this type from the input type.
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Give this value the specified foreground colour.
Give this value the specified background colour.
Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more
Uses borrowed data to replace owned data, usually by cloning.
Read more
Converts the given value to a
String
.
Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.