pub struct ToolContext<M: InputSender> {
pub message_sender: M,
pub group_id: ThreadId,
pub callback_url: String,
pub user_id: Option<String>,
pub thread_stack: Vec<ThreadId>,
pub safe_spawn_point: Option<usize>,
}Expand description
Context passed to tool implementations — generic over platform backends.
Fields§
§message_sender: M§group_id: ThreadId§callback_url: String§user_id: Option<String>§thread_stack: Vec<ThreadId>Full thread stack: [root, ..ancestors, current_thread].
safe_spawn_point: Option<usize>The current thread’s safe spawn point at the moment of a synchronous
tool execution: the absolute store order cutting right before the
tool call being executed (see
HistoryManager::safe_spawn_point).
spawn_thread uses it to exclude its own call from the child’s
inherited history (the child gets a duplicated copy in its own store
instead, so the call survives parent-side compaction). Only set
during synchronous tool execution; None elsewhere.
Trait Implementations§
Source§impl<M: Clone + InputSender> Clone for ToolContext<M>
impl<M: Clone + InputSender> Clone for ToolContext<M>
Auto Trait Implementations§
impl<M> Freeze for ToolContext<M>where
M: Freeze,
impl<M> RefUnwindSafe for ToolContext<M>where
M: RefUnwindSafe,
impl<M> Send for ToolContext<M>
impl<M> Sync for ToolContext<M>
impl<M> Unpin for ToolContext<M>where
M: Unpin,
impl<M> UnsafeUnpin for ToolContext<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for ToolContext<M>where
M: 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