pub struct CoverageReport { /* private fields */ }Expand description
Coverage report containing all coverage data
Implementations§
Source§impl CoverageReport
impl CoverageReport
Sourcepub fn new(total_blocks: usize) -> Self
pub fn new(total_blocks: usize) -> Self
Create a new coverage report for the given number of blocks
Sourcepub fn set_session_name(&mut self, name: &str)
pub fn set_session_name(&mut self, name: &str)
Set the session name
Sourcepub fn record_hit(&mut self, block: BlockId)
pub fn record_hit(&mut self, block: BlockId)
Record a hit on a block
Sourcepub fn record_hits(&mut self, block: BlockId, count: u64)
pub fn record_hits(&mut self, block: BlockId, count: u64)
Record multiple hits on a block
Sourcepub fn record_violation(&mut self, violation: CoverageViolation)
pub fn record_violation(&mut self, violation: CoverageViolation)
Record a violation
Sourcepub fn set_source_location(&mut self, block: BlockId, location: &str)
pub fn set_source_location(&mut self, block: BlockId, location: &str)
Set source location for a block
Sourcepub fn set_function_name(&mut self, block: BlockId, name: &str)
pub fn set_function_name(&mut self, block: BlockId, name: &str)
Set function name for a block
Sourcepub fn get_hit_count(&self, block: BlockId) -> u64
pub fn get_hit_count(&self, block: BlockId) -> u64
Get the hit count for a block
Sourcepub fn is_covered(&self, block: BlockId) -> bool
pub fn is_covered(&self, block: BlockId) -> bool
Check if a block is covered
Sourcepub fn covered_count(&self) -> usize
pub fn covered_count(&self) -> usize
Get the number of covered blocks (only counts blocks in 0..total_blocks)
Sourcepub fn coverage_percent(&self) -> f64
pub fn coverage_percent(&self) -> f64
Get the coverage percentage
Sourcepub fn uncovered_blocks(&self) -> Vec<BlockId>
pub fn uncovered_blocks(&self) -> Vec<BlockId>
Get all uncovered blocks
Sourcepub fn covered_blocks(&self) -> Vec<BlockId>
pub fn covered_blocks(&self) -> Vec<BlockId>
Get all covered blocks
Sourcepub fn summary(&self) -> CoverageSummary
pub fn summary(&self) -> CoverageSummary
Get coverage summary
Sourcepub fn block_coverages(&self) -> Vec<BlockCoverage>
pub fn block_coverages(&self) -> Vec<BlockCoverage>
Get block coverage details
Sourcepub fn violation_count(&self) -> usize
pub fn violation_count(&self) -> usize
Get the number of violations recorded
Sourcepub fn violations(&self) -> &[CoverageViolation]
pub fn violations(&self) -> &[CoverageViolation]
Get all violations
Sourcepub fn is_tainted(&self, block: BlockId) -> bool
pub fn is_tainted(&self, block: BlockId) -> bool
Check if a block is tainted
Sourcepub fn total_blocks(&self) -> usize
pub fn total_blocks(&self) -> usize
Get the total number of blocks
Sourcepub fn session_name(&self) -> Option<&str>
pub fn session_name(&self) -> Option<&str>
Get the session name
Sourcepub fn merge(&mut self, other: &CoverageReport)
pub fn merge(&mut self, other: &CoverageReport)
Merge another report into this one
Trait Implementations§
Source§impl Debug for CoverageReport
impl Debug for CoverageReport
Auto Trait Implementations§
impl Freeze for CoverageReport
impl RefUnwindSafe for CoverageReport
impl Send for CoverageReport
impl Sync for CoverageReport
impl Unpin for CoverageReport
impl UnsafeUnpin for CoverageReport
impl UnwindSafe for CoverageReport
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().