pub struct CoverageReport {
pub endpoints: BTreeMap<(String, String), EndpointHits>,
pub branches: HashMap<String, BranchHits>,
}Expand description
Coverage report with statistics and utilities.
Fields§
§endpoints: BTreeMap<(String, String), EndpointHits>Endpoint coverage: (method, path) -> hits.
branches: HashMap<String, BranchHits>Branch coverage by identifier.
Implementations§
Source§impl CoverageReport
impl CoverageReport
Sourcepub fn endpoint_coverage(&self) -> f64
pub fn endpoint_coverage(&self) -> f64
Calculate endpoint coverage percentage.
Sourcepub fn branch_coverage(&self) -> f64
pub fn branch_coverage(&self) -> f64
Calculate branch coverage percentage.
Sourcepub fn untested_endpoints(&self) -> Vec<(&str, &str)>
pub fn untested_endpoints(&self) -> Vec<(&str, &str)>
Get endpoints that have not been tested.
Sourcepub fn untested_error_paths(&self) -> Vec<(&str, &str)>
pub fn untested_error_paths(&self) -> Vec<(&str, &str)>
Get endpoints with only success responses (no error testing).
Sourcepub fn assert_threshold(&self, threshold: f64)
pub fn assert_threshold(&self, threshold: f64)
Assert that endpoint coverage meets threshold.
§Panics
Panics if coverage is below threshold with a detailed message.
Sourcepub fn write_json(&self, path: &str) -> Result<()>
pub fn write_json(&self, path: &str) -> Result<()>
Sourcepub fn write_html(&self, path: &str) -> Result<()>
pub fn write_html(&self, path: &str) -> Result<()>
Trait Implementations§
Source§impl Clone for CoverageReport
impl Clone for CoverageReport
Source§fn clone(&self) -> CoverageReport
fn clone(&self) -> CoverageReport
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 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 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).