pub struct CoverageResult {
pub files: Vec<FileCoverage>,
pub total_lines: usize,
pub covered_lines: usize,
pub percentage: f64,
pub total_branches: usize,
pub covered_branches: usize,
pub branch_percentage: f64,
}Expand description
Complete coverage result for a project.
Fields§
§files: Vec<FileCoverage>Per-file coverage data
total_lines: usizeTotal lines in all files
covered_lines: usizeTotal covered lines
percentage: f64Overall coverage percentage
total_branches: usizeTotal branches (if available)
covered_branches: usizeCovered branches (if available)
branch_percentage: f64Branch coverage percentage
Implementations§
Source§impl CoverageResult
impl CoverageResult
Sourcepub fn from_files(files: Vec<FileCoverage>) -> Self
pub fn from_files(files: Vec<FileCoverage>) -> Self
Create a CoverageResult from a vector of file coverage data.
Sourcepub fn meets_threshold(&self, threshold: f64) -> bool
pub fn meets_threshold(&self, threshold: f64) -> bool
Check if coverage meets a minimum threshold.
Sourcepub fn worst_files(&self, n: usize) -> Vec<&FileCoverage>
pub fn worst_files(&self, n: usize) -> Vec<&FileCoverage>
Get files sorted by coverage percentage (lowest first).
Sourcepub fn uncovered_file_count(&self) -> usize
pub fn uncovered_file_count(&self) -> usize
Get the number of uncovered files.
Sourcepub fn filter_files<F>(&self, predicate: F) -> Self
pub fn filter_files<F>(&self, predicate: F) -> Self
Filter files by a predicate.
Trait Implementations§
Source§impl Clone for CoverageResult
impl Clone for CoverageResult
Source§fn clone(&self) -> CoverageResult
fn clone(&self) -> CoverageResult
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 CoverageResult
impl Debug for CoverageResult
Auto Trait Implementations§
impl Freeze for CoverageResult
impl RefUnwindSafe for CoverageResult
impl Send for CoverageResult
impl Sync for CoverageResult
impl Unpin for CoverageResult
impl UnsafeUnpin for CoverageResult
impl UnwindSafe for CoverageResult
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