Function combine::parser::byte::num::be_i32

source ·
pub fn be_i32<'a, Input>(
) -> impl Parser<Input, Output = i32, PartialState = ()>
where Input: Stream<Token = u8>,
Expand description

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

use combine::Parser;
use combine::parser::byte::num::le_i32;

assert_eq!(le_i32().parse(&b"\x01\0\0\0"[..]), Ok((1, &b""[..])));
assert!(le_i32().parse(&b"\x01\0\0"[..]).is_err());