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
TestName
Represents a TN
record.
Examples
use lcov::Record; assert_eq!("TN:test_name".parse(), Ok(Record::TestName { name: "test_name".into() }));
Fields of TestName
name: String | test name |
SourceFile
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
path: PathBuf | Absolute path to the source file. |
FunctionName
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
name: String | Function name. |
start_line: u32 | Line number of function start. |
FunctionData
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
name: String | Function name. |
count: u64 | Execution count. |
FunctionsFound
Represents a FNF
record.
Examples
use lcov::Record; assert_eq!("FNF:10".parse(), Ok(Record::FunctionsFound { found: 10 }));
Fields of FunctionsFound
found: u32 | Number of functions found. |
FunctionsHit
Represents a FNH
record.
Examples
use lcov::Record; assert_eq!("FNH:7".parse(), Ok(Record::FunctionsHit { hit: 7 }));
Fields of FunctionsHit
hit: u32 | Number of functions hit. |
BranchData
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: u32 | Line number. |
block: u32 | Block number. |
branch: u32 | Branch number. |
taken: Option<u64> | A number indicating how often that branch was taken. |
BranchesFound
Represents a BRF
record.
Examples
use lcov::Record; assert_eq!("BRF:40".parse(), Ok(Record::BranchesFound { found: 40 }));
Fields of BranchesFound
found: u32 | Number of branches found. |
BranchesHit
Represents a BRH
record.
Examples
use lcov::Record; assert_eq!("BRH:20".parse(), Ok(Record::BranchesHit { hit: 20 }));
Fields of BranchesHit
hit: u32 | Number of branches hit. |
LineData
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: u32 | Line number. |
count: u64 | Execution count. |
checksum: Option<String> | Checksum for each instrumented line. |
LinesFound
Represents a LF
record.
Examples
use lcov::Record; assert_eq!("LF:123".parse(), Ok(Record::LinesFound { found: 123 }));
Fields of LinesFound
found: u32 | Number of instrumented line. |
LinesHit
Represents a LH
record.
Examples
use lcov::Record; assert_eq!("LH:45".parse(), Ok(Record::LinesHit { hit: 45 }));
Fields of LinesHit
hit: u32 | Number of lines with a non-zero execution count. |
EndOfRecord
Represents a end_of_record
record.
Examples
use lcov::Record; assert_eq!("end_of_record".parse(), Ok(Record::EndOfRecord));
Methods
impl Record
[src]
fn kind(&self) -> RecordKind
[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]
type Err = ParseRecordError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
Parses a string s
to return a value of this type. Read more
impl Display for Record
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Debug for Record
[src]
impl Clone for Record
[src]
fn clone(&self) -> Record
[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
impl Eq for Record
[src]
impl PartialEq for Record
[src]
fn eq(&self, __arg_0: &Record) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Record) -> bool
[src]
This method tests for !=
.
impl Ord for Record
[src]
fn cmp(&self, __arg_0: &Record) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl PartialOrd for Record
[src]
fn partial_cmp(&self, __arg_0: &Record) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Record) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Record) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Record) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Record) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more