pub struct PairsHelper<'i, Rule: RuleType>(pub Pairs<'i, Rule>);
Expand description

A useful wrapper around pest Pairs, that provide several convenient shortcuts to read the Pair’s inside it.

It is intended to be used in exhaustive parsing, and will assert that all Pair’s have been read out when this wrapper is dropped.

Tuple Fields

0: Pairs<'i, Rule>

Implementations

Get next Pair. Panics if there is not one.

Get next Pair and assert its rule type. Panics if there is not one, or the rule type does not match.

Get the next Pair if it matches the given Rule. This will not panic.

Create an iterator of the first consecutive Pair’s that match a given Rule.

Trait Implementations

An error message will be printed when this PairsHelper is dropped.

We handled the “double panic” issue by not asserting when the drop is already initiated by another panic.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.