pub enum QuotaError {
TooManyRuns {
tenant: String,
running: u32,
},
SpentOut {
tenant: String,
period: String,
unit: &'static str,
spent: u64,
limit: u64,
},
Halted {
tenant: String,
reason: String,
},
Unavailable(String),
}Expand description
Why a run was not admitted.
Variants§
TooManyRuns
The tenant already has as many runs executing as it may.
Retryable, and that is the point: this is back-pressure, not a fault. The caller should try again rather than treat the work as impossible.
SpentOut
The tenant has spent its ceiling for this period.
Halted
An operator stopped this tenant from starting new work.
Deliberately its own variant rather than a zero ceiling. A ceiling says not right now, and a caller is right to retry it; a halt says somebody is dealing with an incident, and retrying is exactly what an operator pulling the switch is trying to stop. Collapsing the two would teach callers to hammer through the one refusal that means stop.
The accounting itself could not be reached.
Fails closed. A quota that yields when its store is unreachable is a quota an attacker removes by making the store unreachable.
Trait Implementations§
Source§impl Clone for QuotaError
impl Clone for QuotaError
Source§fn clone(&self) -> QuotaError
fn clone(&self) -> QuotaError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QuotaError
impl Debug for QuotaError
Source§impl Display for QuotaError
impl Display for QuotaError
impl Eq for QuotaError
Source§impl Error for QuotaError
impl Error for QuotaError
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
use the Display impl or to_string()
Source§impl From<QuotaError> for RuntimeError
impl From<QuotaError> for RuntimeError
Source§fn from(source: QuotaError) -> Self
fn from(source: QuotaError) -> Self
Source§impl From<StoreError> for QuotaError
impl From<StoreError> for QuotaError
Source§fn from(e: StoreError) -> Self
fn from(e: StoreError) -> Self
Source§impl PartialEq for QuotaError
impl PartialEq for QuotaError
impl StructuralPartialEq for QuotaError
Auto Trait Implementations§
impl Freeze for QuotaError
impl RefUnwindSafe for QuotaError
impl Send for QuotaError
impl Sync for QuotaError
impl Unpin for QuotaError
impl UnsafeUnpin for QuotaError
impl UnwindSafe for QuotaError
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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