Result

Enum Result 

Source
pub enum Result<I: InputIter, O> {
    Complete(I, O),
    Incomplete(I),
    Fail(Error<I>),
    Abort(Error<I>),
}
Expand description

The result of a parsing attempt.

Variants§

§

Complete(I, O)

Complete represents a successful match.

§

Incomplete(I)

Incomplete indicates input ended before a match could be completed. It contains the offset at which the input ended before a match could be completed.

§

Fail(Error<I>)

Fail represents a failed match.

§

Abort(Error<I>)

Abort represents a match failure that the parser cannot recover from.

Implementations§

Source§

impl<I: InputIter, O> Result<I, O>

Source

pub fn is_complete(&self) -> bool

Returns true if the Result is Complete.

Source

pub fn is_incomplete(&self) -> bool

Returns true if the Result is Incomoplete.

Source

pub fn is_fail(&self) -> bool

Returns true if the Result is Fail.

Source

pub fn is_abort(&self) -> bool

Returns true if the Result is Abort.

Trait Implementations§

Source§

impl<I: Debug + InputIter, O: Debug> Debug for Result<I, O>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<I, O> Freeze for Result<I, O>
where I: Freeze, O: Freeze,

§

impl<I, O> RefUnwindSafe for Result<I, O>

§

impl<I, O> Send for Result<I, O>
where I: Send, O: Send,

§

impl<I, O> Sync for Result<I, O>
where I: Sync, O: Sync,

§

impl<I, O> Unpin for Result<I, O>
where I: Unpin, O: Unpin,

§

impl<I, O> UnwindSafe for Result<I, O>
where I: UnwindSafe, O: 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.