pub struct CallCtx {
pub agent_id: Option<AgentId>,
pub tokens: TokenBudget,
pub time: TimeBudget,
pub money: MoneyBudget,
pub iterations: IterationBudget,
pub trace: Vec<String>,
pub extensions: Extensions,
}Expand description
Context passed to Callable::call. Carries the budgets so a
callable can refuse work it can’t afford, plus a typed
Extensions map for substrate-level caller context (clearance,
mandate, decision keys) that flows through to Tool::invoke.
Fields§
§agent_id: Option<AgentId>§tokens: TokenBudget§time: TimeBudget§money: MoneyBudget§iterations: IterationBudget§trace: Vec<String>§extensions: ExtensionsTyped extension map (clearance, mandate, …). Never serialized,
never LLM-writable. See Extensions.
Implementations§
Source§impl CallCtx
impl CallCtx
Sourcepub fn new(
agent_id: Option<AgentId>,
tokens: TokenBudget,
time: TimeBudget,
money: MoneyBudget,
iterations: IterationBudget,
trace: Vec<String>,
) -> Self
pub fn new( agent_id: Option<AgentId>, tokens: TokenBudget, time: TimeBudget, money: MoneyBudget, iterations: IterationBudget, trace: Vec<String>, ) -> Self
Construct a CallCtx with an empty extension map.
Sourcepub fn with_ext<T: Any + Send + Sync>(self, value: T) -> Self
pub fn with_ext<T: Any + Send + Sync>(self, value: T) -> Self
Attach a typed extension, returning self for chaining.
Sourcepub fn insert_ext<T: Any + Send + Sync>(&mut self, value: T)
pub fn insert_ext<T: Any + Send + Sync>(&mut self, value: T)
Attach a typed extension in place.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for CallCtx
impl !UnwindSafe for CallCtx
impl Freeze for CallCtx
impl Send for CallCtx
impl Sync for CallCtx
impl Unpin for CallCtx
impl UnsafeUnpin for CallCtx
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