whitespace

Function whitespace 

Source
pub fn whitespace<'a, C: Char, I: InputType + StrInput<'a, C>, E: ParserExtras<I>>() -> impl Parser<I, (), E>
Expand description

A parser that accepts (and ignores) any number of whitespace characters.

The output type of this parser is ().

ยงExamples

let whitespace = text::whitespace::<_, _, extra::Err<&str>>();

// Any amount of whitespace is parsed...
assert_eq!(whitespace.parse_from(&"\t \n  \r ").into_result(), Ok(()));
// ...including none at all!
assert_eq!(whitespace.parse_from(&"").into_result(), Ok(()));