pub struct GoalBudget {
pub token_budget: Option<u64>,
pub time_budget_seconds: Option<u64>,
pub enforce_token_budget: bool,
pub max_continuations: u32,
}Expand description
The optional token/time bounds on a goal run. None fields mean unbounded
for that resource; the continuation backstop (max_continuations) still
applies unless configured to 0.
Fields§
§token_budget: Option<u64>§time_budget_seconds: Option<u64>§enforce_token_budget: boolWhether token_budget stops the run when reached (#6013). false
keeps the default advisory behavior: crossing the budget logs and
continues. There is no time-budget enforcement because goals carry no
time_budget field — only token_budget can gate.
max_continuations: u32Safety backstop on automatic continuation passes (#5052). 0 disables
the backstop: only terminal status stops the run.
Implementations§
Source§impl GoalBudget
impl GoalBudget
Sourcepub const fn unbounded() -> Self
pub const fn unbounded() -> Self
No token or time cap. Terminal status, user control, and the default continuation backstop still stop the run.
Sourcepub const fn with_token_budget(token_budget: u64) -> Self
pub const fn with_token_budget(token_budget: u64) -> Self
A token budget for telemetry/UI. It never pauses an unbounded goal.
Sourcepub const fn with_enforced_token_budget(self, enforce: bool) -> Self
pub const fn with_enforced_token_budget(self, enforce: bool) -> Self
Opt the token budget into a hard stop ([goal] enforce_token_budget).
With no token_budget set this is a no-op by construction — there is
no ceiling to reach.
Sourcepub const fn with_max_continuations(self, max_continuations: u32) -> Self
pub const fn with_max_continuations(self, max_continuations: u32) -> Self
Override the continuation backstop (0 = unlimited until terminal
status).
Trait Implementations§
Source§impl Clone for GoalBudget
impl Clone for GoalBudget
impl Copy for GoalBudget
Source§impl Debug for GoalBudget
impl Debug for GoalBudget
impl Eq for GoalBudget
Source§impl PartialEq for GoalBudget
impl PartialEq for GoalBudget
impl StructuralPartialEq for GoalBudget
Auto Trait Implementations§
impl Freeze for GoalBudget
impl RefUnwindSafe for GoalBudget
impl Send for GoalBudget
impl Sync for GoalBudget
impl Unpin for GoalBudget
impl UnsafeUnpin for GoalBudget
impl UnwindSafe for GoalBudget
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§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.