combine::parser::byte::num

Function le_i64

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

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

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

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