one_by

Function one_by 

Source
pub fn one_by<CharType, Predicate, ItemType>(
    ch: CharType,
    predicate: Predicate,
) -> SingleEqualByParser<CharType, Predicate, ItemType>
where Predicate: Fn(ItemType, &CharType) -> bool,
Expand description

Check one character is equal to the given character by equility function.

The closure MUST be Fn(Iterator::Item, &CharType) -> bool.

Output: (Iterator::Item,)

ยงExample

use rusty_parser as rp;
use rp::IntoParser;

let a_parser = rp::one_by('a',  |value:char, ch:&char| value.to_ascii_lowercase() == *ch );