pub struct FileCoverage {
pub path: PathBuf,
pub total_lines: usize,
pub covered_lines: usize,
pub uncovered_ranges: Vec<(usize, usize)>,
pub line_hits: HashMap<usize, u64>,
pub total_branches: usize,
pub covered_branches: usize,
}Expand description
Coverage data for a single file.
Fields§
§path: PathBufRelative path to the file
total_lines: usizeTotal executable lines
covered_lines: usizeNumber of lines with coverage
uncovered_ranges: Vec<(usize, usize)>Uncovered line ranges: [(start, end), …]
line_hits: HashMap<usize, u64>Per-line hit counts: line_number -> hit_count
total_branches: usizeTotal branches in the file
covered_branches: usizeCovered branches
Implementations§
Source§impl FileCoverage
impl FileCoverage
Sourcepub fn percentage(&self) -> f64
pub fn percentage(&self) -> f64
Coverage percentage for this file.
Sourcepub fn branch_percentage(&self) -> f64
pub fn branch_percentage(&self) -> f64
Branch coverage percentage for this file.
Sourcepub fn is_fully_covered(&self) -> bool
pub fn is_fully_covered(&self) -> bool
Whether this file has full line coverage.
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 · 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
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