Macro nom::i128 [−][src]
if the parameter is nom::Endianness::Big, parse a big endian i64 integer, otherwise a little endian i64 integer
use nom::number::Endianness; named!(be<i128>, i128!(Endianness::Big)); assert_eq!(be(b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x10\x11\x12\x13\x14\x15abcd"), Ok((&b"abcd"[..], 0x00010203040506070809101112131415))); assert_eq!(be(b"\x01"), Err(Err::Incomplete(Needed::Size(16)))); named!(le<i128>, i128!(Endianness::Little)); assert_eq!(le(b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x10\x11\x12\x13\x14\x15abcd"), Ok((&b"abcd"[..], 0x15141312111009080706050403020100))); assert_eq!(le(b"\x01"), Err(Err::Incomplete(Needed::Size(16))));