[][src]Module rcombinators::combinators

Structs

Alternative
Ignore

Ignore ignores the result of an inner parser, effectively hiding the result. Useful if consumed input should not be processed further, and simplifies types in combined parsers.

Lazy

Lazy is a helper for a typical situation where you have an Alternative or a Sequence and don't want to construct an expensive parser every time just in order for it to be dropped without having parsed anything. For example:

Maybe

Maybe is a combinator returning Option for a parser returning T, meaning it does not stop parsing if an optional input was not encountered. It is very similar to a Repeat parser with RepeatSpec::Max(1).

PartialSequence

PartialSequence concatenates parsers and tries to parse as far as possible.

Repeat
Sequence

Sequence concatenates parsers and only succeeds if all of them do. T is always a tuple in order for Sequence to implement the Parser trait. The result is a tuple of all the parser results.

Then

Applies one parser, discards the result, and returns the second parser's results if the first one succeeded. To skip the input consumed by several parsers, use a Sequence combinators as A.

Transform

Transform applies a function (which may fail) to the result of a parser. Transform only succeeds if the applied function succeeds, too.

Enums

RepeatSpec