Enum nom::IResult [] [src]

pub enum IResult<I, O, E = u32> {
    Done(I, O),
    Error(Err<I, E>),
    Incomplete(Needed),
}

Holds the result of parsing functions

It depends on I, the input type, O, the output type, and E, the error type (by default u32)

Variants

Done

indicates a correct parsing, the first field containing the rest of the unparsed data, the second field contains the parsed data

Error

contains a Err, an enum that can indicate an error code, a position in the input, and a pointer to another error, making a list of errors in the parsing tree

Incomplete

Incomplete contains a Needed, an enum than can represent a known quantity of input data, or unknown

Methods

impl<I, O> IResult<I, O>

fn is_done(&self) -> bool

fn is_err(&self) -> bool

fn is_incomplete(&self) -> bool

Trait Implementations

impl<'a, I, O> GetInput<&'a [I]> for IResult<&'a [I], O>

fn remaining_input(&self) -> Option<&'a [I]>

impl<'a, O> GetInput<()> for IResult<(), O>

fn remaining_input(&self) -> Option<()>

impl<'a, I, O> GetOutput<&'a [O]> for IResult<I, &'a [O]>

fn output(&self) -> Option<&'a [O]>

impl<'a, I> GetOutput<()> for IResult<I, ()>

fn output(&self) -> Option<()>

Derived Implementations

impl<I: Clone, O: Clone, E: Clone> Clone for IResult<I, O, E>

fn clone(&self) -> IResult<I, O, E>

fn clone_from(&mut self, source: &Self)

impl<I: Eq, O: Eq, E: Eq> Eq for IResult<I, O, E>

impl<I: PartialEq, O: PartialEq, E: PartialEq> PartialEq for IResult<I, O, E>

fn eq(&self, __arg_0: &IResult<I, O, E>) -> bool

fn ne(&self, __arg_0: &IResult<I, O, E>) -> bool

impl<I: Debug, O: Debug, E: Debug> Debug for IResult<I, O, E>

fn fmt(&self, __arg_0: &mut Formatter) -> Result