[go: up one dir, main page]

[][src]Function combine::parser::byte::num::u32

pub fn u32<'a, B, Input>() -> U32<B, Input> where
    Input: Stream<Token = u8>,
    Input::Error: ParseError<Input::Token, Input::Range, Input::Position>,
    B: ByteOrder

Reads a u32 out of the byte stream with the specified endianess

use combine::byteorder::LE;
use combine::Parser;
use combine::parser::byte::num::u32;

assert_eq!(u32::<LE, _>().parse(&b"\x01\0\0\0"[..]), Ok((1, &b""[..])));
assert!(u32::<LE, _>().parse(&b"\x01\0\0"[..]).is_err());