nom8

Type Alias IResult

Source
pub type IResult<I, O, E = Error<I>> = Result<(I, O), Err<E>>;
Expand description

Holds the result of parsing functions

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

The Ok side is a pair containing the remainder of the input (the part of the data that was not parsed) and the produced value. The Err side contains an instance of nom8::Err.

Outside of the parsing code, you can use the FinishIResult::finish method to convert it to a more common result type

Aliased Type§

enum IResult<I, O, E = Error<I>> {
    Ok((I, O)),
    Err(Err<E>),
}

Variants§

§1.0.0

Ok((I, O))

Contains the success value

§1.0.0

Err(Err<E>)

Contains the error value

Trait Implementations§

Source§

impl<I, O, E> FinishIResult<I, O, E> for IResult<I, O, E>

Source§

fn finish(self) -> Result<O, E>

Converts the parser’s IResult to a type that is more consumable by callers. Read more
Source§

fn finish_err(self) -> Result<(I, O), E>

Converts the parser’s IResult to a type that is more consumable by errors. Read more
Source§

impl<I, E> IntoOutputIResult<I, <I as IntoOutput>::Output, E> for IResult<I, I, E>
where I: IntoOutput,

Source§

fn into_output(self) -> IResult<I, <I as IntoOutput>::Output, E>

Convert an Input into an appropriate Output type