pub struct ToolExecutionContext {Show 20 fields
pub requested_name: String,
pub canonical_id: String,
pub display_name: String,
pub provider_id: Option<String>,
pub registry_version: u64,
pub policy_version: u64,
pub runtime_control_version: u64,
pub call_id: String,
pub source: ToolCallSource,
pub actor: ToolActorContext,
pub cancellation: ToolCancellationToken,
pub started_at: DateTime<Utc>,
pub deadline: Option<DateTime<Utc>>,
pub permission: ToolPolicyDecisionRecord,
pub approval: Option<ToolApprovalRecord>,
pub classification: ToolCallClassification,
pub safety: ToolSafetyMetadata,
pub limits: ToolExecutionLimits,
pub policy_snapshot: Value,
pub custom_config: Value,
}Expand description
Context passed unchanged from the shared executor into a tool implementation.
Fields§
§requested_name: StringTool name, alias, or display name requested by the caller.
canonical_id: StringCanonical tool ID used for policy, HITL, recovery, and evidence.
display_name: StringDisplay name resolved from the registry.
provider_id: Option<String>Provider ID for provider-backed tools.
registry_version: u64Registry snapshot version used for this call.
policy_version: u64Policy snapshot version used for this call.
runtime_control_version: u64Runtime-control snapshot version used for this call.
call_id: StringStable call ID used in records and history.
source: ToolCallSourceRuntime path that requested this call.
actor: ToolActorContextActor and sender identity for the current turn.
cancellation: ToolCancellationTokenCooperative cancellation observer.
started_at: DateTime<Utc>UTC time at which shared executor handling started.
deadline: Option<DateTime<Utc>>UTC deadline derived from the timeout budget.
permission: ToolPolicyDecisionRecordPermission decision that allowed this call to reach the tool.
approval: Option<ToolApprovalRecord>HITL decision evidence when approval was checked.
classification: ToolCallClassificationCall-level safety classification after arguments are known.
safety: ToolSafetyMetadataStatic tool safety metadata from the resolved registration.
limits: ToolExecutionLimitsEffective limits that tools must treat as upper bounds.
policy_snapshot: ValueRaw per-tool policy snapshot when the runtime is allowed to expose it.
custom_config: ValueCustom settings from tool_security.tools.<tool_id>.config.
Implementations§
Source§impl ToolExecutionContext
impl ToolExecutionContext
Sourcepub fn test(tool_id: impl Into<String>) -> ToolExecutionContext
pub fn test(tool_id: impl Into<String>) -> ToolExecutionContext
Builds a minimal context for unit tests and direct examples.
Trait Implementations§
Source§impl Clone for ToolExecutionContext
impl Clone for ToolExecutionContext
Source§fn clone(&self) -> ToolExecutionContext
fn clone(&self) -> ToolExecutionContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ToolExecutionContext
impl RefUnwindSafe for ToolExecutionContext
impl Send for ToolExecutionContext
impl Sync for ToolExecutionContext
impl Unpin for ToolExecutionContext
impl UnsafeUnpin for ToolExecutionContext
impl UnwindSafe for ToolExecutionContext
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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