pub trait StreamError<Item, Range>: Sized {
Show 19 methods // Required methods fn unexpected_token(token: Item) -> Self; fn unexpected_range(token: Range) -> Self; fn unexpected_format<T>(msg: T) -> Self where T: Display; fn expected_token(token: Item) -> Self; fn expected_range(token: Range) -> Self; fn expected_format<T>(msg: T) -> Self where T: Display; fn message_token(token: Item) -> Self; fn message_range(token: Range) -> Self; fn message_format<T>(msg: T) -> Self where T: Display; fn is_unexpected_end_of_input(&self) -> bool; fn into_other<T>(self) -> T where T: StreamError<Item, Range>; // Provided methods fn unexpected<E>(info: E) -> Self where E: for<'s> ErrorInfo<'s, Item, Range> { ... } fn unexpected_static_message(msg: &'static str) -> Self { ... } fn expected<E>(info: E) -> Self where E: for<'s> ErrorInfo<'s, Item, Range> { ... } fn expected_static_message(msg: &'static str) -> Self { ... } fn message_static_message(msg: &'static str) -> Self { ... } fn message<E>(info: E) -> Self where E: for<'s> ErrorInfo<'s, Item, Range> { ... } fn other<E>(err: E) -> Self where E: StdError + Send + Sync + 'static { ... } fn end_of_input() -> Self { ... }
}
Expand description

StreamError represents a single error returned from a Stream or a Parser.

Usually multiple instances of StreamError is composed into a ParseError to build the final error value.

Required Methods§

source

fn unexpected_token(token: Item) -> Self

source

fn unexpected_range(token: Range) -> Self

source

fn unexpected_format<T>(msg: T) -> Self
where T: Display,

source

fn expected_token(token: Item) -> Self

source

fn expected_range(token: Range) -> Self

source

fn expected_format<T>(msg: T) -> Self
where T: Display,

source

fn message_token(token: Item) -> Self

source

fn message_range(token: Range) -> Self

source

fn message_format<T>(msg: T) -> Self
where T: Display,

source

fn is_unexpected_end_of_input(&self) -> bool

source

fn into_other<T>(self) -> T
where T: StreamError<Item, Range>,

Converts self into a different StreamError type.

This should aim to preserve as much information as possible into the returned T value but if Self ignores some information passed to it using one of the constructors that information is naturally lost.

Provided Methods§

source

fn unexpected<E>(info: E) -> Self
where E: for<'s> ErrorInfo<'s, Item, Range>,

source

fn unexpected_static_message(msg: &'static str) -> Self

source

fn expected<E>(info: E) -> Self
where E: for<'s> ErrorInfo<'s, Item, Range>,

source

fn expected_static_message(msg: &'static str) -> Self

source

fn message_static_message(msg: &'static str) -> Self

source

fn message<E>(info: E) -> Self
where E: for<'s> ErrorInfo<'s, Item, Range>,

source

fn other<E>(err: E) -> Self
where E: StdError + Send + Sync + 'static,

source

fn end_of_input() -> Self

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<Item, Range> StreamError<Item, Range> for combine::stream::easy::Error<Item, Range>
where Item: PartialEq, Range: PartialEq,

Available on crate feature std only.
source§

impl<Item, Range> StreamError<Item, Range> for combine::stream::read::Error

Available on crate feature std only.
source§

impl<Item, Range> StreamError<Item, Range> for StringStreamError

source§

impl<Item, Range> StreamError<Item, Range> for UnexpectedParse