pub struct ToolRunCtx {
pub cancel: CancellationToken,
pub correlation_id: Option<String>,
pub source: Option<String>,
}Expand description
Context passed to a tool runner (and, optionally, to the tools it runs) for a single batch.
Carries a [CancellationToken] so long-running async tools can opt in to
cooperative cancellation. Tools that ignore the context continue to work
unchanged.
Fields§
§cancel: CancellationTokenCancellation token signalled when the batch is aborted (e.g. by
barge-in or a manual interrupt()).
correlation_id: Option<String>Optional correlation id propagated to per-tool tracing.
source: Option<String>Optional source identifier propagated to per-tool tracing.
Trait Implementations§
Source§impl Clone for ToolRunCtx
impl Clone for ToolRunCtx
Source§fn clone(&self) -> ToolRunCtx
fn clone(&self) -> ToolRunCtx
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 ToolRunCtx
impl Debug for ToolRunCtx
Source§impl Default for ToolRunCtx
impl Default for ToolRunCtx
Source§fn default() -> ToolRunCtx
fn default() -> ToolRunCtx
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ToolRunCtx
impl RefUnwindSafe for ToolRunCtx
impl Send for ToolRunCtx
impl Sync for ToolRunCtx
impl Unpin for ToolRunCtx
impl UnsafeUnpin for ToolRunCtx
impl UnwindSafe for ToolRunCtx
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