[−][src]Enum lcov::record::Record
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
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
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
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
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]
pub 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 Clone for Record
[src]
fn clone(&self) -> Record
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Ord for Record
[src]
fn cmp(&self, other: &Record) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl Eq for Record
[src]
impl PartialOrd<Record> for Record
[src]
fn partial_cmp(&self, other: &Record) -> Option<Ordering>
[src]
fn lt(&self, other: &Record) -> bool
[src]
fn le(&self, other: &Record) -> bool
[src]
fn gt(&self, other: &Record) -> bool
[src]
fn ge(&self, other: &Record) -> bool
[src]
impl PartialEq<Record> for Record
[src]
impl Display for Record
[src]
impl Debug for Record
[src]
impl FromStr for Record
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,