Function combine::parser::byte::space[][src]

pub fn space<Input>() -> impl Parser<Input, Output = u8, PartialState = ()> where
    Input: Stream<Token = u8>,
    Input::Error: ParseError<Input::Token, Input::Range, Input::Position>, 
Expand description

Parses a b' ', b'\t', b'\n' or 'b\'r'.

use combine::Parser;
use combine::parser::byte::space;
assert_eq!(space().parse(&b" "[..]), Ok((b' ', &b""[..])));
assert_eq!(space().parse(&b"  "[..]), Ok((b' ', &b" "[..])));
assert!(space().parse(&b"!"[..]).is_err());
assert!(space().parse(&b""[..]).is_err());