[−][src]Macro nom::length_bytes
length_bytes!(&[T] -> IResult<&[T], nb>) => &[T] -> IResult<&[T], &[T]>
Gets a number from the first parser, then extracts that many bytes from the
remaining stream
Example
named!(with_length, length_bytes!( be_u8 )); let r = with_length(&b"\x05abcdefgh"[..]); assert_eq!(r, Ok((&b"fgh"[..], &b"abcde"[..])));