Enum nom::IResult [] [src]

pub enum IResult<I, O, E = u32> {
    Done(I, O),
    Error(Err<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

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

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 contains a Needed, an enum than can represent a known quantity of input data, or unknown

Methods

impl<I, O, E> IResult<I, O, E>
[src]

[src]

Maps a IResult<I, O, E> to IResult<I, O, N> by appling a function to a contained Error value, leaving Done and Incomplete value untouched.

[src]

Unwrap the contained Error(E) value, or panic if the IResult is not Error.

[src]

Convert the IResult to a std::result::Result

[src]

Convert the IResult to a std::result::Result, or panic if the IResult is Incomplete

impl<I, O, E> IResult<I, O, E>
[src]

[src]

[src]

[src]

[src]

[src]

Maps a IResult<I, O, E> to IResult<I, N, E> by appling a function to a contained Done value, leaving Error and Incomplete value untouched.

[src]

Maps a IResult<I, O, E> to IResult<I, O, E> by appling a function to a contained Incomplete value, leaving Done and Error value untouched.

[src]

Unwrap the contained Done(I, O) value, or panic if the IResult is not Done.

[src]

Unwrap the contained Done(I, O) value or a default if the IResult is not Done.

[src]

Unwrap the contained Incomplete(n) value, or panic if the IResult is not Incomplete.

Trait Implementations

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

[src]

Formats the value using the given formatter.

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

[src]

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

[src]

This method tests for !=.

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

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

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]