pub struct PresentClaim<'a> { /* private fields */ }Expand description
Per-claim builder for a possibly-absent (Option-valued) metric.
Produced by Verdict::claim_present and the
claim_present! macro. On Some(v) every
comparator delegates to the value-bound ClaimBuilder, so a
present metric behaves EXACTLY like claim!. On
None the metric is absent — there is nothing to compare, so every
comparator records a LOUD Fail (<name>: metric absent) rather
than silently passing. This mirrors the no-guessed-value discipline
of MetricId::def returning None for an unregistered key: an
absent signal fails the gate, it does not vacuously satisfy it (the
hazard of metric.unwrap_or(0.0), where a missing metric becomes a
sentinel that can pass a bound).
Implementations§
Source§impl<'a> PresentClaim<'a>
impl<'a> PresentClaim<'a>
Sourcepub fn kind(self, kind: DetailKind) -> Self
pub fn kind(self, kind: DetailKind) -> Self
Override the DetailKind recorded on failure (whether the
metric is absent OR present-but-out-of-bound). Mirrors
ClaimBuilder::kind.
Sourcepub fn because(self, reason: &'a str) -> Self
pub fn because(self, reason: &'a str) -> Self
Attach a rationale appended to the failure message as
(reason). Mirrors ClaimBuilder::because.
Sourcepub fn at_least(self, floor: f64) -> &'a mut Verdict
pub fn at_least(self, floor: f64) -> &'a mut Verdict
Present and >= floor; absent → Fail. See
ClaimBuilder::at_least.
Sourcepub fn at_most(self, ceiling: f64) -> &'a mut Verdict
pub fn at_most(self, ceiling: f64) -> &'a mut Verdict
Present and <= ceiling; absent → Fail. See
ClaimBuilder::at_most.
Sourcepub fn lt(self, ceiling: f64) -> &'a mut Verdict
pub fn lt(self, ceiling: f64) -> &'a mut Verdict
Present and < ceiling; absent → Fail. See ClaimBuilder::lt.
Sourcepub fn gt(self, floor: f64) -> &'a mut Verdict
pub fn gt(self, floor: f64) -> &'a mut Verdict
Present and > floor; absent → Fail. See ClaimBuilder::gt.
Sourcepub fn between(self, lo: f64, hi: f64) -> &'a mut Verdict
pub fn between(self, lo: f64, hi: f64) -> &'a mut Verdict
Present and within [lo, hi] (inclusive); absent → Fail. See
ClaimBuilder::between.
Sourcepub fn near(self, target: f64, tolerance: f64) -> &'a mut Verdict
pub fn near(self, target: f64, tolerance: f64) -> &'a mut Verdict
Present and within tolerance of target; absent → Fail. See
ClaimBuilder::near.
Sourcepub fn is_finite(self) -> &'a mut Verdict
pub fn is_finite(self) -> &'a mut Verdict
Present and finite (neither NaN nor ±∞); absent → Fail. See
ClaimBuilder::is_finite.
Auto Trait Implementations§
impl<'a> Freeze for PresentClaim<'a>
impl<'a> RefUnwindSafe for PresentClaim<'a>
impl<'a> Send for PresentClaim<'a>
impl<'a> Sync for PresentClaim<'a>
impl<'a> Unpin for PresentClaim<'a>
impl<'a> !UnwindSafe for PresentClaim<'a>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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