[−][src]Macro nom::take
take!(nb) => &[T] -> IResult<&[T], &[T]>
generates a parser consuming the specified number of bytes
Example
// Desmond parser named!(take5, take!( 5 ) ); let a = b"abcdefgh"; assert_eq!(take5(&a[..]), Ok((&b"fgh"[..], &b"abcde"[..])));