# Module nom::combinator

source · [−]
Expand description

General purpose combinators

## Structs

ParserIterator

Main structure associated to the iterator function.

## Functions

all_consuming

Succeeds if all the input has been consumed by its child parser.

complete

Transforms Incomplete into `Error`.

cond

Calls the parser if the condition is met.

consumed

if the child parser was successful, return the consumed input with the output as a tuple. Functions similarly to recognize except it returns the parser output as well.

cut

Transforms an `Err::Error` (recoverable) to `Err::Failure` (unrecoverable)

eof

returns its input if it is at the end of input data

fail

A parser which always fails.

flat_map

Creates a new parser from the output of the first parser, then apply that parser over the rest of the input.

into

automatically converts the child parser’s result to another type

iterator

Creates an iterator from input data and a parser.

map

Maps a function on the result of a parser.

map_opt

Applies a function returning an `Option` over the result of a parser.

map_parser

Applies a parser over the result of another one.

map_res

Applies a function returning a `Result` over the result of a parser.

not

Succeeds if the child parser returns an error.

opt

Optional parser, will return `None` on `Err::Error`.

peek

Tries to apply its parser without consuming the input.

recognize

If the child parser was successful, return the consumed input as produced value.

rest

Return the remaining input.

rest_len

Return the length of the remaining input.

success

a parser which always succeeds with given value without consuming any input.

value

Returns the provided value if the child parser succeeds.

verify

Returns the result of the child parser if it satisfies a verification function.