Function read_limit_zero_yields_nothing
pub async fn read_limit_zero_yields_nothing<F: Fixture>(
open: impl AsyncFn() -> F,
) -> RuleOutcomeExpand description
limit(0) yields nothing.
VT-28, and phase 4 is the phase that can express it: until limit
became Option<usize> the builder stored NonZeroUsize::new(limit), so
zero became None — unlimited — before any adapter saw it, and the input
this rule needs was not representable through the API.
The caller it protects is the one writing .limit(budget - fetched). Under
the wrong implementation a paging loop that reaches parity does not read
zero events; it reads the entire log, unbounded, silently — no error,
no rejection, and a memory ceiling that stops being a ceiling.
It rejects LimitZeroIsUnlimitedStore, which is the DCB reference
implementation’s if (limit) falsiness ported to a language where 0 is
not falsy, and FetchOneExtraStore, whose LIMIT n + 1 cursor probe
hands back one event when it was asked for none.
The limit(1) read at the end is the non-vacuity anchor, and this rule
cannot do without it: every assertion above it is is_empty(), which a
store returning nothing at all satisfies for free.