#[non_exhaustive]pub enum Denial {
QuotaExceeded {
limit: u64,
retry_after: Duration,
},
StorageCapacity {
retry_after: Option<Duration>,
},
}Expand description
Structured details for a denied check.
A quota denial always contains its policy limit and the remaining window measured by the backend. A storage-capacity denial may contain the duration until the backend’s earliest known expiry, when one is available.
Process-local backends can measure the duration at evaluation time exactly. Distributed backends may return a safe upper bound measured with their authoritative clock, which can overstate the duration at the caller by commit and transport time.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
QuotaExceeded
Consuming the requested cost would exceed the configured quota.
Fields
StorageCapacity
A bounded backend could not safely allocate storage for a new key.
Implementations§
Source§impl Denial
impl Denial
Sourcepub const fn retry_after(&self) -> Option<Duration>
pub const fn retry_after(&self) -> Option<Duration>
Returns the backend-reported duration after which the caller may retry, if known.
Sourcepub const fn retry_after_seconds(&self) -> Option<u64>
pub const fn retry_after_seconds(&self) -> Option<u64>
Returns a whole-second Retry-After value rounded up, if known.
The underlying Duration remains available through
Denial::retry_after. Values beyond the representable range saturate
at u64::MAX.