Function warc_parser::record [] [src]

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

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