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

pub fn newline<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 newline byte (b'\n').

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