pub struct OwnedToolContext {
pub session_id: SessionId,
pub turn_id: TurnId,
pub metadata: MetadataMap,
pub permissions: Arc<dyn PermissionChecker>,
pub resources: Arc<dyn ToolResources>,
pub cancellation: Option<TurnCancellation>,
}Expand description
Owned execution context that can outlive a single stack frame.
This is useful for schedulers or task managers that need to move a tool
execution onto another task while still constructing the borrowed
ToolContext expected by existing tool implementations.
Fields§
§session_id: SessionIdSession identifier for the invocation.
turn_id: TurnIdTurn identifier for the invocation.
metadata: MetadataMapArbitrary invocation metadata.
permissions: Arc<dyn PermissionChecker>Shared permission checker.
resources: Arc<dyn ToolResources>Shared resources injected by the host.
cancellation: Option<TurnCancellation>Cooperative cancellation signal for the invocation.
Implementations§
Source§impl OwnedToolContext
impl OwnedToolContext
Sourcepub fn borrowed(&self) -> ToolContext<'_>
pub fn borrowed(&self) -> ToolContext<'_>
Creates a borrowed ToolContext view over this owned context.
Trait Implementations§
Source§impl Clone for OwnedToolContext
impl Clone for OwnedToolContext
Source§fn clone(&self) -> OwnedToolContext
fn clone(&self) -> OwnedToolContext
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 OwnedToolContext
impl !RefUnwindSafe for OwnedToolContext
impl Send for OwnedToolContext
impl Sync for OwnedToolContext
impl Unpin for OwnedToolContext
impl UnsafeUnpin for OwnedToolContext
impl !UnwindSafe for OwnedToolContext
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