#[non_exhaustive]pub enum BudgetExceeded {
Steps {
allowed: usize,
},
Effects {
allowed: usize,
used: usize,
},
Replans {
allowed: u32,
},
Denials {
allowed: u32,
},
Recorded {
limit: String,
used: String,
},
Tokens {
allowed: u64,
used: u64,
},
Money {
allowed: u64,
used: u64,
},
Wallclock {
allowed: u64,
used: u64,
},
Egress {
allowed: u64,
used: u64,
attempted: u64,
},
Rate {
grant: String,
allowed: u32,
window_seconds: u64,
reached: u64,
},
}Expand description
Which limit stopped the run, and where it stood.
Carries the numbers rather than a message: an operator raising a limit needs to know what it actually reached, and “budget exhausted” does not say.
§Why the messages state a rule and not a tally
Every metered ceiling here is a pre-dispatch gate on reaching the limit:
nothing further starts once the figure is at the ceiling, because a step that
would exceed it must not half-run and then be stopped. The refusal is
therefore raised at used == allowed, where {allowed} permitted, {used} consumed prints two equal numbers beside the word exhausted and reads
like an off-by-one. Telling otherwise means finding the comparison in this
file, and a refusal message is the one artifact put in front of somebody who
never will. So each states its rule. Egress is the
exception twice over: an outbound size is known before dispatch, so that
ceiling is exact rather than reached, and its message says what the refused
call would have sent.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Steps
Effects
Replans
Denials
The run was refused by the policy more often than it is allowed to be.
Not a policy failure — a probing ceiling. See
Budget::max_denials.
Recorded
A refusal read back from the journal.
Carries the recorded limit rather than the one in force now, because a run replayed under a larger budget still stopped where it stopped.
Tokens
Money
Wallclock
Egress
The run tried to send more than it may.
Carries attempted as well as used, which the metered ceilings cannot:
this one is checked against a size known before dispatch, so an operator
raising the limit sees both where the run stood and what it was about to
send — and can tell a ceiling that is too low from one call that is too
big.
Rate
A tool’s cross-run rate ceiling had no room for this call.
Not this run’s consumption: the count is the tenant’s, across runs, so
reached is how many calls to grant already fell in the window. The
window slides, so a resume once enough of them have aged out continues
the run.
Implementations§
Source§impl BudgetExceeded
impl BudgetExceeded
Sourcepub const fn as_str(&self) -> &'static str
pub const fn as_str(&self) -> &'static str
Which limit was hit, for a metric label.
The variant only — never the rendered message. Display here embeds the
allowed and used figures, and a label carrying those is a new time series
per distinct budget, which is how a metrics backend falls over. See
runtime::metrics.
Trait Implementations§
Source§impl Clone for BudgetExceeded
impl Clone for BudgetExceeded
Source§impl Debug for BudgetExceeded
impl Debug for BudgetExceeded
Source§impl<'de> Deserialize<'de> for BudgetExceeded
impl<'de> Deserialize<'de> for BudgetExceeded
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for BudgetExceeded
impl Display for BudgetExceeded
impl Eq for BudgetExceeded
Source§impl Error for BudgetExceeded
impl Error for BudgetExceeded
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<BudgetExceeded> for StepError
impl From<BudgetExceeded> for StepError
Source§fn from(source: BudgetExceeded) -> Self
fn from(source: BudgetExceeded) -> Self
Source§impl JsonSchema for BudgetExceeded
impl JsonSchema for BudgetExceeded
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for BudgetExceeded
impl PartialEq for BudgetExceeded
Source§impl Serialize for BudgetExceeded
impl Serialize for BudgetExceeded
impl StructuralPartialEq for BudgetExceeded
Auto Trait Implementations§
impl Freeze for BudgetExceeded
impl RefUnwindSafe for BudgetExceeded
impl Send for BudgetExceeded
impl Sync for BudgetExceeded
impl Unpin for BudgetExceeded
impl UnsafeUnpin for BudgetExceeded
impl UnwindSafe for BudgetExceeded
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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