Function combine::byte::num::be_u16
[−]
[src]
pub fn be_u16<'a, I>() -> U16<BE, I> where
I: RangeStream<Range = &'a [u8]>,
Reads a u16 out of the byte stream with the specified endianess
use combine::byteorder::LE; use combine::Parser; use combine::byte::num::u16; assert_eq!(u16::<LE, _>().parse(&b"\x01\0"[..]), Ok((1, &b""[..]))); assert!(u16::<LE, _>().parse(&b"\0"[..]).is_err());