Struct lcov::report::Report
[−]
[src]
pub struct Report { pub sections: Sections, }
An accumulated coverage information from some LCOV tracefiles.
Report
is used for merging/filtering the coverage information.
Examples
Merges LCOV tracefiles and outputs the result in LCOV tracefile format:
use lcov::Report; let mut report = Report::new(); // Merges a first file. report.merge(Report::from_file("report_a.info")?)?; // Merges a second file. report.merge(Report::from_file("report_b.info")?)?; // Outputs the merge result in LCOV tracefile format. for record in report.into_records() { println!("{}", record); }
Fields
sections: Sections
Coverage information about every source files.
Methods
impl Report
[src]
pub fn new() -> Self
[src]
pub fn from_reader<I, E>(iter: I) -> Result<Self, ParseError<E>> where
I: IntoIterator<Item = Result<Record, E>>,
[src]
I: IntoIterator<Item = Result<Record, E>>,
Creates a report from LCOV record reader.
Examples
use lcov::{Report, Reader}; let input = "\ TN:test_name SF:/path/to/source/file.rs DA:1,2 DA:3,0 DA:5,6 LF:3 LH:2 end_of_record "; let reader = Reader::new(input.as_bytes()); let report = Report::from_reader(reader)?;
pub fn from_file<P>(path: P) -> Result<Self, ParseError<ReadError>> where
P: AsRef<Path>,
[src]
P: AsRef<Path>,
Creates a report from LCOV tracefile.
Examples
use lcov::Report; let report = Report::from_file("report.info")?;
pub fn merge(&mut self, other: Self) -> Result<(), MergeError>
[src]
Merges a report into self
.
Examples
use lcov::Report; let mut report = Report::from_file("report1.info")?; report.merge(Report::from_file("report2.info")?)?;
pub fn merge_lossy(&mut self, other: Self)
[src]
Merges a report into self
with ignoring an Errors.
Examples
use lcov::Report; let mut report = Report::from_file("report1.info")?; report.merge_lossy(Report::from_file("report2.info")?);
ⓘImportant traits for IntoRecordspub fn into_records(self) -> IntoRecords
[src]
ⓘImportant traits for IntoRecords
Creates an iterator which iterates over [LCOV section].
Examples
use lcov::Report; let mut report = Report::from_file("report.info")?; // ... Manipulate report for record in report.into_records() { println!("{}", record); }
Trait Implementations
impl Debug for Report
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for Report
[src]
fn clone(&self) -> Report
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more