Skip to main content

AnyParser

Enum AnyParser 

Source
pub enum AnyParser<'input, I, T>
where I: Iterator<Item = char>, T: BorrowedInput<'input>,
{ String { parser: Parser<'input, StrInput<'input>>, name: String, }, Iter { parser: Parser<'static, BufferedInput<I>>, name: String, }, Custom { parser: Parser<'input, T>, name: String, }, Replay { parser: ReplayParser<'input>, name: String, }, }
Expand description

A wrapper for different types of parsers.

Variants§

§

String

A parser over a string input.

Fields

§parser: Parser<'input, StrInput<'input>>

The parser itself.

§name: String

The name of the parser.

§

Iter

A parser over an iterator input.

Fields

§parser: Parser<'static, BufferedInput<I>>

The parser itself.

§name: String

The name of the parser.

§

Custom

A parser over a custom input.

Fields

§parser: Parser<'input, T>

The parser itself.

§name: String

The name of the parser.

§

Replay

A parser over a replayed event stream.

Fields

§parser: ReplayParser<'input>

The replay parser itself.

§name: String

The name of the parser.

Auto Trait Implementations§

§

impl<'input, I, T> Freeze for AnyParser<'input, I, T>
where T: Freeze, I: Freeze,

§

impl<'input, I, T> RefUnwindSafe for AnyParser<'input, I, T>

§

impl<'input, I, T> Send for AnyParser<'input, I, T>
where T: Send, I: Send,

§

impl<'input, I, T> Sync for AnyParser<'input, I, T>
where T: Sync, I: Sync,

§

impl<'input, I, T> Unpin for AnyParser<'input, I, T>
where T: Unpin, I: Unpin,

§

impl<'input, I, T> UnsafeUnpin for AnyParser<'input, I, T>
where T: UnsafeUnpin, I: UnsafeUnpin,

§

impl<'input, I, T> UnwindSafe for AnyParser<'input, I, T>
where T: UnwindSafe, I: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.