pub enum BudgetDecision {
Allow,
SoftLimit {
resource: String,
consumed: f64,
limit: f64,
message: Option<String>,
},
Deny {
resource: String,
reason: String,
},
}Expand description
Outcome of a budget check.
The framework treats this purely as a decision — it never inspects
the carried strings except to forward them to AgentEvents and to
the eventual error.
Variants§
Allow
Operation proceeds normally. No event is emitted.
SoftLimit
Operation proceeds, but the framework emits a
AgentEvent::BudgetThresholdHit { kind: "soft", .. }
event before continuing. In-session hooks can react (e.g. trigger
auto-compact, swap to a cheaper model on next turn).
Fields
Deny
Operation is refused. The framework returns
CodeError::BudgetExhausted
from the LLM / tool entry point. The session itself stays open —
callers can re-try later or after the host has re-allocated
budget.
Trait Implementations§
Source§impl Clone for BudgetDecision
impl Clone for BudgetDecision
Source§fn clone(&self) -> BudgetDecision
fn clone(&self) -> BudgetDecision
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BudgetDecision
impl RefUnwindSafe for BudgetDecision
impl Send for BudgetDecision
impl Sync for BudgetDecision
impl Unpin for BudgetDecision
impl UnsafeUnpin for BudgetDecision
impl UnwindSafe for BudgetDecision
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
Converts
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>
Converts
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