[−][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
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
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.
Represents a FN
record.
Examples
use lcov::Record; assert_eq!("FN:10,main".parse(), Ok(Record::FunctionName { name: "main".into(), start_line: 10 }));
Represents a FNDA
record.
Examples
use lcov::Record; assert_eq!("FNDA:1,main".parse(), Ok(Record::FunctionData { name: "main".into(), count: 1 }));
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.
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.
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
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.
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.
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
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.
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.
Represents a end_of_record
record.
Examples
use lcov::Record; assert_eq!("end_of_record".parse(), Ok(Record::EndOfRecord));
Implementations
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]
impl Debug for Record
[src]
impl Display for Record
[src]
impl Eq for Record
[src]
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]
impl Ord for Record
[src]
fn cmp(&self, other: &Record) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Record> 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 StructuralEq for Record
[src]
impl StructuralPartialEq for Record
[src]
Auto Trait Implementations
impl RefUnwindSafe for Record
impl Send for Record
impl Sync for Record
impl Unpin for Record
impl UnwindSafe for Record
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,