pub struct FileCoverage {
pub path: String,
pub lines: BTreeMap<u32, u64>,
}Expand description
Per-line hit counts for a single source file.
Only executable lines are present in lines; a line absent from the map is
not instrumented (blank, comment, etc.) and must not be counted towards
coverage totals.
Fields§
§path: StringRepo-relative path of the source file.
lines: BTreeMap<u32, u64>Map of 1-based line number to hit count.
Implementations§
Source§impl FileCoverage
impl FileCoverage
Sourcepub fn record(&mut self, line: u32, hits: u64)
pub fn record(&mut self, line: u32, hits: u64)
Records hits for line. Repeated records for the same line take the
maximum, so a line covered by any region counts as covered.
Sourcepub fn total_lines(&self) -> u64
pub fn total_lines(&self) -> u64
Number of executable lines.
Sourcepub fn covered_lines(&self) -> u64
pub fn covered_lines(&self) -> u64
Number of executable lines hit at least once.
Trait Implementations§
Source§impl Clone for FileCoverage
impl Clone for FileCoverage
Source§fn clone(&self) -> FileCoverage
fn clone(&self) -> FileCoverage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileCoverage
impl Debug for FileCoverage
impl Eq for FileCoverage
Source§impl PartialEq for FileCoverage
impl PartialEq for FileCoverage
Source§fn eq(&self, other: &FileCoverage) -> bool
fn eq(&self, other: &FileCoverage) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for FileCoverage
Auto Trait Implementations§
impl Freeze for FileCoverage
impl RefUnwindSafe for FileCoverage
impl Send for FileCoverage
impl Sync for FileCoverage
impl Unpin for FileCoverage
impl UnsafeUnpin for FileCoverage
impl UnwindSafe for FileCoverage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.