Enum lcov::record::Record [] [src]

pub enum Record {
    TestName {
        name: String,
    },
    SourceFile {
        path: PathBuf,
    },
    FunctionName {
        name: String,
        start_line: u32,
    },
    FunctionData {
        name: String,
        count: u64,
    },
    FunctionsFound {
        found: u32,
    },
    FunctionsHit {
        hit: u32,
    },
    BranchData {
        line: u32,
        block: u32,
        branch: u32,
        taken: Option<u64>,
    },
    BranchesFound {
        found: u32,
    },
    BranchesHit {
        hit: u32,
    },
    LineData {
        line: u32,
        count: u64,
        checksum: Option<String>,
    },
    LinesFound {
        found: u32,
    },
    LinesHit {
        hit: u32,
    },
    EndOfRecord,
}

Represents all kinds of LCOV records.

This struct can be created by parsing an LCOV record string by parse method (provided by the FromStr trait). This struct can be converted into an LCOV record string by to_string method (provided by the ToString trait).

See those documentation for more.

Variants

Represents a TN record.

Examples

use lcov::Record;
assert_eq!("TN:test_name".parse(), Ok(Record::TestName { name: "test_name".into() }));

Fields of TestName

test name

Represents a SF record.

Examples

use lcov::Record;
assert_eq!("SF:/usr/include/stdio.h".parse(),
           Ok(Record::SourceFile { path: "/usr/include/stdio.h".into() }));

Fields of SourceFile

Absolute path to the source file.

Represents a FN record.

Examples

use lcov::Record;
assert_eq!("FN:10,main".parse(),
           Ok(Record::FunctionName { name: "main".into(), start_line: 10 }));

Fields of FunctionName

Function name.

Line number of function start.

Represents a FNDA record.

Examples

use lcov::Record;
assert_eq!("FNDA:1,main".parse(),
           Ok(Record::FunctionData { name: "main".into(), count: 1 }));

Fields of FunctionData

Function name.

Execution count.

Represents a FNF record.

Examples

use lcov::Record;
assert_eq!("FNF:10".parse(), Ok(Record::FunctionsFound { found: 10 }));

Fields of FunctionsFound

Number of functions found.

Represents a FNH record.

Examples

use lcov::Record;
assert_eq!("FNH:7".parse(), Ok(Record::FunctionsHit { hit: 7 }));

Fields of FunctionsHit

Number of functions hit.

Represents a BRDA record.

block and branch are gcc internal IDs for the branch.

Examples

use lcov::Record;
assert_eq!("BRDA:10,30,40,-".parse(),
           Ok(Record::BranchData { line: 10, block: 30, branch: 40, taken: None }));
assert_eq!("BRDA:10,30,40,3".parse(),
           Ok(Record::BranchData { line: 10, block: 30, branch: 40, taken: Some(3) }));

Fields of BranchData

Line number.

Block number.

Branch number.

A number indicating how often that branch was taken.

Represents a BRF record.

Examples

use lcov::Record;
assert_eq!("BRF:40".parse(), Ok(Record::BranchesFound { found: 40 }));

Fields of BranchesFound

Number of branches found.

Represents a BRH record.

Examples

use lcov::Record;
assert_eq!("BRH:20".parse(), Ok(Record::BranchesHit { hit: 20 }));

Fields of BranchesHit

Number of branches hit.

Represents a DA record.

Examples

use lcov::Record;
assert_eq!("DA:8,30".parse(), Ok(Record::LineData { line: 8, count: 30, checksum: None }));
assert_eq!("DA:8,30,asdfasdf".parse(),
           Ok(Record::LineData { line: 8, count: 30, checksum: Some("asdfasdf".into()) }));

Fields of LineData

Line number.

Execution count.

Checksum for each instrumented line.

Represents a LF record.

Examples

use lcov::Record;
assert_eq!("LF:123".parse(), Ok(Record::LinesFound { found: 123 }));

Fields of LinesFound

Number of instrumented line.

Represents a LH record.

Examples

use lcov::Record;
assert_eq!("LH:45".parse(), Ok(Record::LinesHit { hit: 45 }));

Fields of LinesHit

Number of lines with a non-zero execution count.

Represents a end_of_record record.

Examples

use lcov::Record;
assert_eq!("end_of_record".parse(), Ok(Record::EndOfRecord));

Methods

impl Record
[src]

[src]

Returns the corresponding RecordKind for this record.

Examples

use lcov::{Record, RecordKind};
let rec = Record::LinesHit { hit: 32 };
assert_eq!(rec.kind(), RecordKind::LinesHit);

Trait Implementations

impl FromStr for Record
[src]

The associated error which can be returned from parsing.

[src]

Parses a string s to return a value of this type. Read more

impl Display for Record
[src]

[src]

Formats the value using the given formatter. Read more

impl Debug for Record
[src]

[src]

Formats the value using the given formatter.

impl Clone for Record
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Eq for Record
[src]

impl PartialEq for Record
[src]

[src]

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

[src]

This method tests for !=.

impl Ord for Record
[src]

[src]

This method returns an Ordering between self and other. Read more

1.22.0
[src]

Compares and returns the maximum of two values. Read more

1.22.0
[src]

Compares and returns the minimum of two values. Read more

impl PartialOrd for Record
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

[src]

This method tests less than (for self and other) and is used by the < operator. Read more

[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more