[][src]Function warc_parser::record

pub fn record(input: &[u8]) -> IResult<&[u8], Record>

Parses one record and returns an IResult from nom

IResult<&u8, Record>

See records for processing more then one. The documentation is not displaying.

Examples

This example is not tested
 extern crate warc_parser;
 extern crate nom;
 use nom::{IResult};
 let parsed = warc_parser::record(&bbc);
 match parsed{
     IResult::Error(_) => assert!(false),
     Err::Incomplete(_) => assert!(false),
     Ok((i, entry)) => {
         let empty: Vec<u8> =  Vec::new();
         assert_eq!(empty, i);
         assert_eq!(13, entry.headers.len());
     }
 }