Function chomp::combinators::matched_by
[−]
[src]
pub fn matched_by<'a, I, T, E, F>(i: Input<'a, I>, f: F) -> ParseResult<'a, I, (&'a [I], T), E> where T: 'a, F: FnOnce(Input<'a, I>) -> ParseResult<'a, I, T, E>
Returns the result of the given parser as well as the slice which matched it.
use chomp::{Input, matched_by}; use chomp::ascii::decimal; let i = Input::new(b"123"); assert_eq!(matched_by(i, decimal).unwrap(), (&b"123"[..], 123u32));