pub struct ToolExecutionScope { /* private fields */ }Expand description
Shared by a child’s run, tools, providers and detached foreign callbacks.
Implementations§
Source§impl ToolExecutionScope
impl ToolExecutionScope
pub fn with_context(context: Value) -> Self
Sourcepub fn run<F: Future>(
self: &Arc<Self>,
future: F,
) -> impl Future<Output = F::Output>
pub fn run<F: Future>( self: &Arc<Self>, future: F, ) -> impl Future<Output = F::Output>
Bind the task-local identity without an extra async state machine. An
async wrapper would reserve storage for both future and its moved copy
inside TaskLocalFuture, doubling large callers’ inline future size.
Tokio installs the identity only while polling or dropping the future.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ToolExecutionScope
impl Forget for ToolExecutionScope
impl Move for ToolExecutionScope
impl RefUnwindSafe for ToolExecutionScope
impl Send for ToolExecutionScope
impl Sync for ToolExecutionScope
impl Unpin for ToolExecutionScope
impl UnsafeUnpin for ToolExecutionScopewhere
Align8<usize>: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
*const Waiter is !null: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<Bucket<String, Value>>: UnsafeUnpin,
impl UnwindSafe for ToolExecutionScopewhere
Align8<usize>: UnwindSafe,
Notify: UnwindSafe,
RawVecInner: UnwindSafe,
NonNull<u8>: 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