#[non_exhaustive]pub enum CountBound {
Exact(u64),
AtLeast(u64),
AtMost(u64),
Range(u64, u64),
}Expand description
The recorded-request count bound of a RequestExpectation:
exactly one bound form per expectation. Poll semantics per bound
(arrivals only add, so the filtered count is monotone
non-decreasing):
- Without a deadline, one immediate snapshot decides for every bound.
CountBound::Exactpolls until a snapshot’s count equalsn; a snapshot above never passes.CountBound::AtLeastsucceeds early, once the count reachesn(sound: the count only grows).CountBound::AtMostis an absence claim over the window: it waits the full deadline, fails immediately on any snapshot aboven, and decides on the final snapshot — an early passing snapshot cannot prove the count stays within bounds.CountBound::Rangefails immediately above the maximum and otherwise waits the full deadline, deciding on the final snapshot within[min, max].
These semantics document a monotone subject: arrivals only add, so the filtered count is non-decreasing and a reached count stays reached. SQL row counts are NOT monotone — a DELETE shrinks the row set — so SQL count assertions never settle early; the final snapshot at the deadline decides.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Exact(u64)
Exactly n matching requests.
AtLeast(u64)
At least n matching requests (early success at n or more).
AtMost(u64)
At most n matching requests (absence claim over the window).
Range(u64, u64)
Between min and max matching requests, inclusive.
Trait Implementations§
Source§impl Clone for CountBound
impl Clone for CountBound
Source§fn clone(&self) -> CountBound
fn clone(&self) -> CountBound
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CountBound
impl Debug for CountBound
Source§impl PartialEq for CountBound
impl PartialEq for CountBound
impl StructuralPartialEq for CountBound
Auto Trait Implementations§
impl Freeze for CountBound
impl RefUnwindSafe for CountBound
impl Send for CountBound
impl Sync for CountBound
impl Unpin for CountBound
impl UnsafeUnpin for CountBound
impl UnwindSafe for CountBound
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