[−][src]Struct combine::stream::easy::Errors
std only.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: PThe 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
impl<T, R, P> Errors<T, R, P>[src]
pub fn new(position: P, error: Error<T, R>) -> Errors<T, R, P>[src]
Constructs a new ParseError which occurred at position.
pub fn empty(position: P) -> Errors<T, R, P>[src]
Constructs an error with no other information than the position it occurred at.
pub fn from_errors(position: P, errors: Vec<Error<T, R>>) -> Errors<T, R, P>[src]
Constructs a ParseError with multiple causes.
pub fn end_of_input(position: P) -> Errors<T, R, P>[src]
Constructs an end of input error. Should be returned by parsers which encounter end of input unexpectedly.
pub fn add_error(&mut self, error: Error<T, R>) where
T: PartialEq,
R: PartialEq, [src]
T: PartialEq,
R: PartialEq,
Adds an error if error does not exist in this ParseError already (as determined byte
PartialEq).
pub fn set_expected(&mut self, info: Info<T, R>)[src]
Removes all Expected errors in self and adds info instead.
pub fn merge(self, other: Errors<T, R, P>) -> Errors<T, R, P> where
P: Ord,
T: PartialEq,
R: PartialEq, [src]
P: Ord,
T: PartialEq,
R: PartialEq,
Merges two ParseErrors. 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.
pub fn map_position<F, Q>(self, f: F) -> Errors<T, R, Q> where
F: FnOnce(P) -> Q, [src]
F: FnOnce(P) -> Q,
Maps the position to a new value
pub fn map_token<F, U>(self, f: F) -> Errors<U, R, P> where
F: FnMut(T) -> U, [src]
F: FnMut(T) -> U,
Maps all token variants to a new value
pub fn map_range<F, S>(self, f: F) -> Errors<T, S, P> where
F: FnMut(R) -> S, [src]
F: FnMut(R) -> S,
Maps all range variants to a new value.
use combine::*; use combine::parser::range::range; println!( "{}", range(&"HTTP"[..]) .easy_parse("HTT") .unwrap_err() .map_range(|bytes| format!("{:?}", bytes)) );
Trait Implementations
impl<T: Debug, R: Debug, P: Debug> Debug for Errors<T, R, P>[src]
impl<T, R, P> Display for Errors<T, R, P> where
P: Display,
T: Display,
R: Display, [src]
P: Display,
T: Display,
R: Display,
impl<T, R, P> Error for Errors<T, R, P> where
P: Display + Debug,
T: Display + Debug,
R: Display + Debug, [src]
P: Display + Debug,
T: Display + Debug,
R: Display + Debug,
pub fn description(&self) -> &str[src]
pub fn source(&self) -> Option<&(dyn Error + 'static)>1.30.0[src]
pub fn backtrace(&self) -> Option<&Backtrace>[src]
pub fn cause(&self) -> Option<&dyn Error>1.0.0[src]
impl<'a, P> From<Error<Errors<u8, &'a [u8], P>, P>> for Errors<u8, &'a [u8], P> where
P: Ord + Clone, [src]
P: Ord + Clone,
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,
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>,
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>,
impl<Item, Range, Position> ParseErrorInto<Item, Range, Position> for Errors<Item, Range, Position>[src]
pub fn into_other_error<T, Item2, Range2, Position2>(self) -> T where
T: ParseError<Item2, Range2, Position2>,
Item2: From<Item>,
Range2: From<Range>,
Position2: From<Position>, [src]
T: ParseError<Item2, Range2, Position2>,
Item2: From<Item>,
Range2: From<Range>,
Position2: From<Position>,
impl<T: PartialEq, R: PartialEq, P: PartialEq> PartialEq<Errors<T, R, P>> for Errors<T, R, P>[src]
pub fn eq(&self, other: &Errors<T, R, P>) -> bool[src]
pub fn ne(&self, other: &Errors<T, R, P>) -> bool[src]
impl<T, R, P> StructuralPartialEq for Errors<T, R, P>[src]
Auto Trait Implementations
impl<T, R, P> !RefUnwindSafe for Errors<T, R, P>[src]
impl<T, R, P> Send for Errors<T, R, P> where
P: Send,
R: Send,
T: Send, [src]
P: Send,
R: Send,
T: Send,
impl<T, R, P> Sync for Errors<T, R, P> where
P: Sync,
R: Sync,
T: Sync, [src]
P: Sync,
R: Sync,
T: Sync,
impl<T, R, P> Unpin for Errors<T, R, P> where
P: Unpin,
R: Unpin,
T: Unpin, [src]
P: Unpin,
R: Unpin,
T: Unpin,
impl<T, R, P> !UnwindSafe for Errors<T, R, P>[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow(&self) -> &TⓘNotable traits for &'_ mut W
impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;[src]
Notable traits for &'_ mut W
impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut TⓘNotable traits for &'_ mut W
impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;[src]
Notable traits for &'_ mut W
impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,