pub enum DiskThrottleValidationError {
BurstBelowRate {
dimension: ThrottleDimension,
burst: u64,
rate: u64,
},
BurstWithoutRate {
dimension: ThrottleDimension,
},
}Expand description
Validation failure for DiskThrottle::validate.
Returned by DiskThrottle::validate when a throttle/burst
chain violates the constraints documented on DiskThrottle.
The Display impl carries the same actionable text the previous
String-returning shape did (with the “, or pass 0 to clear …”
remediation hint preserved) so callers that bubble the error
through anyhow::Error and match on the rendered message keep
working.
Tests that need to assert on a specific failure variant downcast
via err.downcast_ref::<DiskThrottleValidationError>() (when the
error is wrapped in anyhow) or pattern-match the enum directly.
The dimension() accessor exposes which
dimension (iops/bytes) tripped the rule for callers that route
programmatic recovery (e.g. clear the offending
*_burst_capacity and retry).
Variants§
BurstBelowRate
*_burst_capacity is set to a value strictly below the
corresponding * refill rate. A bucket with capacity below
its refill rate cannot hold a full second of refilled
tokens, so the effective steady-state rate would silently be
the capacity, not the configured rate.
Fields
dimension: ThrottleDimensionThrottle dimension this failure applies to.
BurstWithoutRate
*_burst_capacity is set with no matching * refill rate.
A bucket with no refill rate is a functionally unbounded
one-shot capacity, which does not match any useful
throttling model.
Fields
dimension: ThrottleDimensionThrottle dimension this failure applies to.
Implementations§
Source§impl DiskThrottleValidationError
impl DiskThrottleValidationError
Sourcepub fn dimension(&self) -> ThrottleDimension
pub fn dimension(&self) -> ThrottleDimension
Throttle dimension (iops/bytes) the failure applies to. Lets
callers route a programmatic recovery without parsing the
rendered message — e.g. “clear the offending burst override
and re-validate” can dispatch on this without string-matching
iops_burst_capacity vs bytes_burst_capacity.
Trait Implementations§
Source§impl Clone for DiskThrottleValidationError
impl Clone for DiskThrottleValidationError
Source§fn clone(&self) -> DiskThrottleValidationError
fn clone(&self) -> DiskThrottleValidationError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DiskThrottleValidationError
impl Debug for DiskThrottleValidationError
Source§impl Error for DiskThrottleValidationError
impl Error for DiskThrottleValidationError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl Hash for DiskThrottleValidationError
impl Hash for DiskThrottleValidationError
impl Eq for DiskThrottleValidationError
impl StructuralPartialEq for DiskThrottleValidationError
Auto Trait Implementations§
impl Freeze for DiskThrottleValidationError
impl RefUnwindSafe for DiskThrottleValidationError
impl Send for DiskThrottleValidationError
impl Sync for DiskThrottleValidationError
impl Unpin for DiskThrottleValidationError
impl UnwindSafe for DiskThrottleValidationError
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> ErrorExt for T
impl<T> ErrorExt for T
§fn and_raise<T>(self, context: T) -> Exn<T>
fn and_raise<T>(self, context: T) -> Exn<T>
§fn raise_erased(self) -> Exnwhere
Self: Sized,
fn raise_erased(self) -> Exnwhere
Self: Sized,
§fn raise_all<T, I>(self, sources: I) -> Exn<Self>where
Self: Sized,
T: Error + Send + Sync + 'static,
I: IntoIterator,
<I as IntoIterator>::Item: Into<Exn<T>>,
fn raise_all<T, I>(self, sources: I) -> Exn<Self>where
Self: Sized,
T: Error + Send + Sync + 'static,
I: IntoIterator,
<I as IntoIterator>::Item: Into<Exn<T>>,
sources as causes.§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