pub struct SelfTestReport {
pub positive_pass: usize,
pub positive_fail: usize,
pub negative_caught: BTreeMap<String, usize>,
pub negative_missed: BTreeMap<String, usize>,
pub operations: Vec<OperationResult>,
}Expand description
Summary report rolled up across all operations.
Fields§
§positive_pass: usize§positive_fail: usize§negative_caught: BTreeMap<String, usize>Per category: count of negative cases the server correctly rejected with a 4xx (we caught the spec violation).
negative_missed: BTreeMap<String, usize>Per category: count of negative cases that should have been rejected but came back with a non-4xx (validator gap).
operations: Vec<OperationResult>Implementations§
Source§impl SelfTestReport
impl SelfTestReport
Sourcepub fn all_passed(&self) -> bool
pub fn all_passed(&self) -> bool
All-pass means every positive case got 2xx-3xx and every negative case got 4xx.
Sourcepub fn detect_target_misconfiguration(&self) -> Option<u16>
pub fn detect_target_misconfiguration(&self) -> Option<u16>
Round 18.1 — detect the “self-test target is misconfigured”
case where every positive failed with the same status code.
The classic example: --base-path /api was forgotten so every
request hits a path the server doesn’t know and returns 404.
Pre-warning, the user saw all-green negative buckets (because
“missing route” 404s look like “validator rejected”) and no
indication that the run was meaningless. Returns Some(status)
when ≥10 positives all failed with the same status, else None.
Sourcepub fn render_summary(&self) -> String
pub fn render_summary(&self) -> String
Human-readable summary string. One line for positives, one per
category for negatives. Designed to slot into existing
TerminalReporter output.
Trait Implementations§
Source§impl Clone for SelfTestReport
impl Clone for SelfTestReport
Source§fn clone(&self) -> SelfTestReport
fn clone(&self) -> SelfTestReport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SelfTestReport
impl Debug for SelfTestReport
Source§impl Default for SelfTestReport
impl Default for SelfTestReport
Source§fn default() -> SelfTestReport
fn default() -> SelfTestReport
Auto Trait Implementations§
impl Freeze for SelfTestReport
impl RefUnwindSafe for SelfTestReport
impl Send for SelfTestReport
impl Sync for SelfTestReport
impl Unpin for SelfTestReport
impl UnsafeUnpin for SelfTestReport
impl UnwindSafe for SelfTestReport
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
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: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 more