Struct combine::easy::Errors [−][src]
Expand description
Struct which hold information about an error that occurred at a specific position.
Can hold multiple instances of Error
if more that one error occurred in the same position.
Fields
position: P
The position where the error occurred
errors: Vec<Error<T, R>>
A vector containing specific information on what errors occurred at position
. Usually
a fully formed message contains one Unexpected
error and one or more Expected
errors.
Message
and Other
may also appear (combine
never generates these errors on its own)
and may warrant custom handling.
Implementations
Constructs a new ParseError
which occurred at position
.
Constructs an error with no other information than the position it occurred at.
Constructs a ParseError
with multiple causes.
Constructs an end of input error. Should be returned by parsers which encounter end of input unexpectedly.
Adds an error if error
does not exist in this ParseError
already (as determined byte
PartialEq
).
Removes all Expected
errors in self
and adds info
instead.
Merges two ParseError
s. If they exist at the same position the errors of other
are
added to self
(using add_error
to skip duplicates). If they are not at the same
position the error furthest ahead are returned, ignoring the other ParseError
.
Maps the position to a new value
Maps all token variants to a new value
Trait Implementations
type StreamError = Error<Item, Range>
Creates a ParseError
from a single Self::StreamError
Sets the position of this ParseError
Merges two errors. If they exist at the same position the errors of other
are
added to self
(using the semantics of add
). If they are not at the same
position the error furthest ahead are returned, ignoring the other ParseError
. Read more
Adds a StreamError
to self
. Read more
fn set_expected<F>(self_: &mut Tracked<Self>, info: Self::StreamError, f: F) where
F: FnOnce(&mut Tracked<Self>),
fn set_expected<F>(self_: &mut Tracked<Self>, info: Self::StreamError, f: F) where
F: FnOnce(&mut Tracked<Self>),
Sets info
as the only Expected
error of self
Removes any expected errors currently in self
Does a best-effort conversion of self
into another ParseError