Enum nom::IResult [] [src]

pub enum IResult<'a, I, O> {
    Done(I, O),
    Error(Err<'a>),
    Incomplete(Needed),
}

Holds the result of parsing functions

It depends on I, the input types, and O, the output type.

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

  • Error is currently a u32, but should be updated to indicate which parser had a problem, a description, and an eventual stack of parser to know which path failed

  • Incomplete will hold the closure used to restart the computation once more data is available. Current attemps at implementation of Incomplete are progressing, but slowed down by lifetime problems

Variants

Done(I, O)Error(Err<'a>)Incomplete(Needed)

Methods

impl<'a, I, O> IResult<'a, I, O>
[src]

fn is_done(&self) -> bool

fn is_err(&self) -> bool

fn is_incomplete(&self) -> bool

Trait Implementations

impl<'a, I: Clone, O: Clone> Clone for IResult<'a, I, O>
[src]

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

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl<'a, I: Eq, O: Eq> Eq for IResult<'a, I, O>
[src]

impl<'a, I: PartialEq, O: PartialEq> PartialEq for IResult<'a, I, O>
[src]

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

This method tests for self and other values to be equal, and is used by ==. Read more

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

This method tests for !=.

impl<'a, I: Debug, O: Debug> Debug for IResult<'a, I, O>
[src]

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

Formats the value using the given formatter.

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

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

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

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

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

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

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

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