pub struct Report {
    pub sections: Sections,
}
Expand description

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.

Implementations

Creates an empty report.

Examples
use lcov::Report;
let report = Report::new();

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)?;

Creates a report from LCOV tracefile.

Examples
use lcov::Report;

let report = Report::from_file("report.info")?;

Merges a report into self.

Examples
use lcov::Report;

let mut report = Report::from_file("report1.info")?;
report.merge(Report::from_file("report2.info")?)?;

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")?);

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.