pub fn be_i32<I, E: ParseError<I>>() -> impl Parser<I, Output = i32, Error = E>
Expand description
Recognizes a big endian signed 4 bytes integer.
use nom::number::be_i32;
let mut parser = be_i32::<_, (_, ErrorKind)>();
assert_eq!(parser.parse(&b"\x00\x01\x02\x03abcd"[..]), Ok((&b"abcd"[..], 0x00010203)));
assert_eq!(parser.parse(&b""[..]), Err(Err::Incomplete(Needed::new(4))));