Type Definition nom8::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

Trait Implementations§

source§

impl<I, O, E> FinishIResult<I, O, E> for IResult<I, O, E>where I: InputLength + IntoOutput + InputIsStreaming<false> + Clone, E: ParseError<I>,

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