pub struct ToolContext {
pub run_id: Option<RunId>,
pub idempotency_key: Option<String>,
}Expand description
Per-call context handed to every tool.
Cheap to clone, so typed tool closures can own a copy across awaits.
run_id names the run that made the call; idempotency_key is the same
for a replayed call and new for every other, for tools that dedupe.
Fields§
§run_id: Option<RunId>§idempotency_key: Option<String>Implementations§
Source§impl ToolContext
impl ToolContext
Trait Implementations§
Source§impl Clone for ToolContext
impl Clone for ToolContext
Source§fn clone(&self) -> ToolContext
fn clone(&self) -> ToolContext
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 moreSource§impl Debug for ToolContext
impl Debug for ToolContext
Source§impl Default for ToolContext
impl Default for ToolContext
Source§fn default() -> ToolContext
fn default() -> ToolContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Forget for ToolContext
impl Freeze for ToolContext
impl Move for ToolContext
impl RefUnwindSafe for ToolContext
impl Send for ToolContextwhere
RawVecInner: Send,
impl Sync for ToolContextwhere
RawVecInner: Sync,
impl Unpin for ToolContext
impl UnsafeUnpin for ToolContext
impl UnwindSafe for ToolContextwhere
RawVecInner: UnwindSafe,
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