pub struct CoverageTracker { /* private fields */ }Expand description
Tracks endpoint coverage during test execution.
Thread-safe and can be shared across multiple test clients.
Implementations§
Source§impl CoverageTracker
impl CoverageTracker
Sourcepub fn register_endpoint(&self, method: Method, path: impl Into<String>)
pub fn register_endpoint(&self, method: Method, path: impl Into<String>)
Register an endpoint for coverage tracking.
Sourcepub fn register_endpoints<'a>(
&self,
endpoints: impl IntoIterator<Item = (Method, &'a str)>,
)
pub fn register_endpoints<'a>( &self, endpoints: impl IntoIterator<Item = (Method, &'a str)>, )
Register multiple endpoints from a route table.
Sourcepub fn record_hit(&self, method: Method, path: &str, status_code: u16)
pub fn record_hit(&self, method: Method, path: &str, status_code: u16)
Record a hit on an endpoint.
Sourcepub fn record_branch(&self, branch_id: impl Into<String>, taken: bool)
pub fn record_branch(&self, branch_id: impl Into<String>, taken: bool)
Record a branch hit.
Sourcepub fn report(&self) -> CoverageReport
pub fn report(&self) -> CoverageReport
Generate a coverage report.
Trait Implementations§
Source§impl Clone for CoverageTracker
impl Clone for CoverageTracker
Source§fn clone(&self) -> CoverageTracker
fn clone(&self) -> CoverageTracker
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 CoverageTracker
impl Debug for CoverageTracker
Auto Trait Implementations§
impl Freeze for CoverageTracker
impl !RefUnwindSafe for CoverageTracker
impl Send for CoverageTracker
impl Sync for CoverageTracker
impl Unpin for CoverageTracker
impl !UnwindSafe for CoverageTracker
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).