[−][src]Trait combine::ParseError
Trait which defines a combine parse error.
A parse error is composed of zero or more StreamError
instances which gets added to it as
errors are encountered during parsing.
Associated Types
type StreamError: StreamError<Item, Range>
[src]
Required methods
pub fn empty(position: Position) -> Self
[src]
Constructs an empty error.
An empty error is expected to be cheap to create as it is frequently created and discarded.
pub fn set_position(&mut self, position: Position)
[src]
Sets the position of this ParseError
pub fn add(&mut self, err: Self::StreamError)
[src]
Adds a StreamError
to self
.
It is up to each individual error type to define what adding an error does, some may push
it to a vector while others may only keep self
or err
to avoid allocation
pub fn set_expected<F>(self_: &mut Tracked<Self>, info: Self::StreamError, f: F) where
F: FnOnce(&mut Tracked<Self>),
[src]
F: FnOnce(&mut Tracked<Self>),
Sets info
as the only Expected
error of self
pub fn is_unexpected_end_of_input(&self) -> bool
[src]
pub fn into_other<T>(self) -> T where
T: ParseError<Item, Range, Position>,
[src]
T: ParseError<Item, Range, Position>,
Does a best-effort conversion of self
into another ParseError
Provided methods
pub fn from_error(position: Position, err: Self::StreamError) -> Self
[src]
Creates a ParseError
from a single Self::StreamError
pub fn position(&self) -> Position
[src]
pub fn merge(self, other: Self) -> Self
[src]
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
.
pub fn add_expected<E>(&mut self, info: E) where
E: for<'s> ErrorInfo<'s, Item, Range>,
[src]
E: for<'s> ErrorInfo<'s, Item, Range>,
pub fn add_unexpected<E>(&mut self, info: E) where
E: for<'s> ErrorInfo<'s, Item, Range>,
[src]
E: for<'s> ErrorInfo<'s, Item, Range>,
pub fn add_message<E>(&mut self, info: E) where
E: for<'s> ErrorInfo<'s, Item, Range>,
[src]
E: for<'s> ErrorInfo<'s, Item, Range>,
pub fn clear_expected(&mut self)
[src]
Removes any expected errors currently in self
Implementors
impl<Item, Range, Position> ParseError<Item, Range, Position> for StringStreamError where
Position: Default,
[src]
Position: Default,
type StreamError = Self
pub fn empty(_position: Position) -> Self
[src]
pub fn from_error(_: Position, err: Self::StreamError) -> Self
[src]
pub fn position(&self) -> Position
[src]
pub fn set_position(&mut self, _position: Position)
[src]
pub fn add(&mut self, err: Self::StreamError)
[src]
pub fn set_expected<F>(self_: &mut Tracked<Self>, info: Self::StreamError, f: F) where
F: FnOnce(&mut Tracked<Self>),
[src]
F: FnOnce(&mut Tracked<Self>),
pub fn is_unexpected_end_of_input(&self) -> bool
[src]
pub fn into_other<T>(self) -> T where
T: ParseError<Item, Range, Position>,
[src]
T: ParseError<Item, Range, Position>,
impl<Item, Range, Position> ParseError<Item, Range, Position> for UnexpectedParse where
Position: Default,
[src]
Position: Default,
type StreamError = Self
pub fn empty(_position: Position) -> Self
[src]
pub fn from_error(_: Position, err: Self::StreamError) -> Self
[src]
pub fn position(&self) -> Position
[src]
pub fn set_position(&mut self, _position: Position)
[src]
pub fn add(&mut self, err: Self::StreamError)
[src]
pub fn set_expected<F>(self_: &mut Tracked<Self>, info: Self::StreamError, f: F) where
F: FnOnce(&mut Tracked<Self>),
[src]
F: FnOnce(&mut Tracked<Self>),
pub fn is_unexpected_end_of_input(&self) -> bool
[src]
pub fn into_other<T>(self) -> T where
T: ParseError<Item, Range, Position>,
[src]
T: ParseError<Item, Range, Position>,
impl<Item, Range, Position> ParseError<Item, Range, Position> for combine::stream::easy::Error<Item, Range> where
Item: PartialEq,
Range: PartialEq,
Position: Default,
[src]
Item: PartialEq,
Range: PartialEq,
Position: Default,
std
only.type StreamError = Self
pub fn empty(_: Position) -> Self
[src]
pub fn from_error(_: Position, err: Self::StreamError) -> Self
[src]
pub fn position(&self) -> Position
[src]
pub fn set_position(&mut self, _position: Position)
[src]
pub fn add(&mut self, err: Self::StreamError)
[src]
pub fn set_expected<F>(self_: &mut Tracked<Self>, info: Self::StreamError, f: F) where
F: FnOnce(&mut Tracked<Self>),
[src]
F: FnOnce(&mut Tracked<Self>),
pub fn is_unexpected_end_of_input(&self) -> bool
[src]
pub fn into_other<T>(self) -> T where
T: ParseError<Item, Range, Position>,
[src]
T: ParseError<Item, Range, Position>,
impl<Item, Range, Position> ParseError<Item, Range, Position> for combine::stream::read::Error where
Position: Default,
[src]
Position: Default,
std
only.type StreamError = Self
pub fn empty(_position: Position) -> Self
[src]
pub fn from_error(_: Position, err: Self::StreamError) -> Self
[src]
pub fn set_position(&mut self, _position: Position)
[src]
pub fn add(&mut self, err: Self::StreamError)
[src]
pub fn set_expected<F>(self_: &mut Tracked<Self>, info: Self::StreamError, f: F) where
F: FnOnce(&mut Tracked<Self>),
[src]
F: FnOnce(&mut Tracked<Self>),
pub fn is_unexpected_end_of_input(&self) -> bool
[src]
pub fn into_other<T>(self) -> T where
T: ParseError<Item, Range, Position>,
[src]
T: ParseError<Item, Range, Position>,
impl<Item, Range, Position> ParseError<Item, Range, Position> for Errors<Item, Range, Position> where
Item: PartialEq,
Range: PartialEq,
Position: Ord + Clone,
[src]
Item: PartialEq,
Range: PartialEq,
Position: Ord + Clone,
std
only.type StreamError = Error<Item, Range>
pub fn empty(pos: Position) -> Self
[src]
pub fn from_error(position: Position, err: Self::StreamError) -> Self
[src]
pub fn position(&self) -> Position
[src]
pub fn set_position(&mut self, position: Position)
[src]
pub fn merge(self, other: Self) -> Self
[src]
pub fn add(&mut self, err: Self::StreamError)
[src]
pub fn set_expected<F>(self_: &mut Tracked<Self>, info: Self::StreamError, f: F) where
F: FnOnce(&mut Tracked<Self>),
[src]
F: FnOnce(&mut Tracked<Self>),
pub fn clear_expected(&mut self)
[src]
pub fn is_unexpected_end_of_input(&self) -> bool
[src]
pub fn into_other<T>(self) -> T where
T: ParseError<Item, Range, Position>,
[src]
T: ParseError<Item, Range, Position>,