pub struct BudgetBlock {
pub name: String,
pub quotas: Vec<BudgetQuota>,
pub on_exhausted: String,
pub loc: Loc,
pub leading_trivia: Vec<Trivia>,
pub trailing_trivia: Vec<Trivia>,
}Expand description
§Fase 72.a — a budget { … } block: a set of per-effect rate quotas plus the
exhaustion policy. Where window guards an effect’s TIMING, budget guards
its RATE — a tool call consumes one token from a renewable bucket, and
over-emission is impossible by construction (the Logic pillar’s linearity
made real for external effects).
Fields§
§name: String§Fase 114.a — the budget’s NAME when it is declared top-level.
Empty ⇒ the daemon-attached form (daemon D { budget { … } }), which is
anonymous and scoped to that daemon’s ticks.
§Why top-level had to exist
Until §114, budget was a field of daemon and nothing else. So an
adopter deploying an HTTP endpoint that calls a vendor tool had no way in
the language to bound how often it does that. Not “the bound did not
work” — the bound could not be written. And the HTTP endpoint is what
people actually deploy.
quotas: Vec<BudgetQuota>The per-effect quotas (rate:/max: lines). At least one.
on_exhausted: StringWhat to do when a quota is exhausted: block (fail-closed, the default) |
defer (reschedule via the §71 defer ledger) | shed (skip the call).
loc: Loc§leading_trivia: Vec<Trivia>§Fase 114.a — comment trivia, so a top-level budget does not silently lose
its doc comments through the formatter (Fase 14.b). Empty for the
daemon-attached form.
trailing_trivia: Vec<Trivia>Trait Implementations§
Auto Trait Implementations§
impl Freeze for BudgetBlock
impl RefUnwindSafe for BudgetBlock
impl Send for BudgetBlock
impl Sync for BudgetBlock
impl Unpin for BudgetBlock
impl UnsafeUnpin for BudgetBlock
impl UnwindSafe for BudgetBlock
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> 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