#[non_exhaustive]pub struct ToolCallContext {
pub tool_name: String,
pub arguments: Option<Value>,
pub identity: Option<String>,
pub role: Option<String>,
pub sub: Option<String>,
pub request_id: Option<String>,
}Expand description
Context passed to before/after hooks for a single tool call.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.tool_name: StringTool name being invoked.
arguments: Option<Value>JSON arguments as sent by the client (may be None).
identity: Option<String>Identity name from the authenticated request, if any.
role: Option<String>RBAC role associated with the request, if any.
sub: Option<String>OAuth sub claim, if present.
request_id: Option<String>Raw JSON-RPC request id rendered as a string, if available.
Implementations§
Source§impl ToolCallContext
impl ToolCallContext
Sourcepub fn for_tool(tool_name: impl Into<String>) -> Self
pub fn for_tool(tool_name: impl Into<String>) -> Self
Construct a ToolCallContext with the given tool name and all
optional fields cleared. Primarily for use in unit tests and
benchmarks of user-supplied hooks; the runtime path populates
these fields from the request and task-local RBAC state.
Trait Implementations§
Source§impl Clone for ToolCallContext
impl Clone for ToolCallContext
Source§fn clone(&self) -> ToolCallContext
fn clone(&self) -> ToolCallContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ToolCallContext
impl RefUnwindSafe for ToolCallContext
impl Send for ToolCallContext
impl Sync for ToolCallContext
impl Unpin for ToolCallContext
impl UnsafeUnpin for ToolCallContext
impl UnwindSafe for ToolCallContext
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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