Struct lcov_parser::LCOVParser
[−]
[src]
pub struct LCOVParser<T> { /* fields omitted */ }
Parse the record one line at a time
Examples
use std::fs:: { File }; use lcov_parser:: { LCOVRecord, LCOVParser }; let s = File::open("tests/fixtures/parser/report.lcov").unwrap(); let mut parser = LCOVParser::new(s); let mut records = vec![]; loop { let result = parser.next().unwrap(); match result { Some(r) => { records.push(r) }, None => { break; } } } assert_eq!(records[0], LCOVRecord::TestName(Some("test".to_string())));
Methods
impl<T: Read> LCOVParser<T>
[src]
pub fn new(reader: T) -> Self
[src]
pub fn parse(&mut self) -> Result<Vec<LCOVRecord>, ParseError>
[src]
pub fn next(&mut self) -> Result<Option<LCOVRecord>, ParseError>
[src]
Trait Implementations
impl FromFile<File> for LCOVParser<File>
[src]
Create a parser from file
Examples
use lcov_parser:: { LCOVParser, LCOVRecord, FromFile }; let mut parser = LCOVParser::from_file("tests/fixtures/parser/report.lcov").unwrap(); let result = parser.next().unwrap(); assert_eq!(result, Some(LCOVRecord::TestName(Some("test".to_string()))));