[−][src]Function combine::parser::range::recognize
pub fn recognize<P>(parser: P) -> Recognize<P> where
<P::Input as StreamOnce>::Error: ParseError<<P::Input as StreamOnce>::Item, <P::Input as StreamOnce>::Range, <P::Input as StreamOnce>::Position>,
P: Parser,
P::Input: RangeStream,
<P::Input as StreamOnce>::Range: Range,
Zero-copy parser which returns consumed input range.
combinator::recognize
is a non-RangeStream
alternative.
let mut parser = recognize(skip_many1(letter())); assert_eq!(parser.parse("hello world"), Ok(("hello", " world"))); assert!(parser.parse("!").is_err());