pub struct ExecutionBudget { /* private fields */ }Expand description
The per-execution budget, shared between the registry and its tools.
One execution is one budget: a script load, a tool call, or a hook. The budget is armed before the execution and cleared after, so the limits apply to a single execution and not to the sum of every execution a script has made.
There is one ExecutionBudget per registry, so exactly one execution may be
armed at a time. The agent loop dispatches tool calls one at a time, and
nothing else runs Lua concurrently, so that holds today. Two overlapping
executions would share the counter and the later clear would disarm the
earlier one; a stack of budgets would make overlap safe if the loop ever
runs calls in parallel.
Trait Implementations§
Auto Trait Implementations§
impl Forget for ExecutionBudget
impl Freeze for ExecutionBudget
impl Move for ExecutionBudget
impl RefUnwindSafe for ExecutionBudget
impl Send for ExecutionBudget
impl Sync for ExecutionBudget
impl Unpin for ExecutionBudget
impl UnsafeUnpin for ExecutionBudget
impl UnwindSafe for ExecutionBudget
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> 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