pub struct ToolContext {
pub tool_id: String,
pub user_task: Option<String>,
pub tool_description: Option<String>,
}Expand description
Context for a tool call being processed by the firewall.
Provides metadata about the tool and the user’s task to enable context-aware filtering decisions.
Fields§
§tool_id: StringTool identifier (e.g., "web_search", "file_read").
user_task: Option<String>The user’s original task or query, when available.
tool_description: Option<String>Tool description from the registry.
Implementations§
Source§impl ToolContext
impl ToolContext
Sourcepub fn with_user_task(self, task: String) -> Self
pub fn with_user_task(self, task: String) -> Self
Set the user’s original task/query.
Sourcepub fn with_tool_description(self, desc: String) -> Self
pub fn with_tool_description(self, desc: String) -> Self
Set the tool description.
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 · 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 ToolContext
impl RefUnwindSafe for ToolContext
impl Send for ToolContext
impl Sync for ToolContext
impl Unpin for ToolContext
impl UnsafeUnpin for ToolContext
impl UnwindSafe for ToolContext
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