Function parser_combinators::satisfy [] [src]

pub fn satisfy<I, Pred>(pred: Pred) -> Satisfy<I, Pred> where I: Stream<Item=char>, Pred: FnMut(char) -> bool

Parses a character and succeeds depending on the result of pred

 let result = satisfy(|c| c == '!')
     .parse("!")
     .map(|x| x.0);
 assert_eq!(result, Ok('!'));