Skip to main content

Reply

Enum Reply 

Source
pub enum Reply<'i> {
    Success {
        tokens: Vec<Token<'i>>,
        state: State<'i>,
    },
    Failure,
    Error(ParseError),
}
Expand description

The outcome of applying a parser to a State.

Variants§

§

Success

The parser matched; tokens are accumulated; state is the updated state.

Fields

§tokens: Vec<Token<'i>>
§state: State<'i>
§

Failure

The parser did not match; no input was consumed; the state is unchanged. The caller may try an alternative.

§

Error(ParseError)

The parser encountered an unrecoverable error after committing to a branch. Alternatives are not tried — this propagates up the call stack unchanged.

Trait Implementations§

Source§

impl<'i> Debug for Reply<'i>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'i> Freeze for Reply<'i>

§

impl<'i> RefUnwindSafe for Reply<'i>

§

impl<'i> Send for Reply<'i>

§

impl<'i> Sync for Reply<'i>

§

impl<'i> Unpin for Reply<'i>

§

impl<'i> UnsafeUnpin for Reply<'i>

§

impl<'i> UnwindSafe for Reply<'i>

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.