pub struct HookGuardedTool<'a> { /* private fields */ }Expand description
Any tool wrapped so an extension’s on_tool_call hooks see it.
This is the reduction primitive adds. Before it, an extension could
only add a tool; now one can refuse a call, including a call to a built-in.
The wrapper is transparent in both directions: def is the inner tool’s, so
the model sees an unchanged tool list, and run only differs when a hook
vetoes.
Trait Implementations§
Source§impl Tool for HookGuardedTool<'_>
impl Tool for HookGuardedTool<'_>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for HookGuardedTool<'a>
impl<'a> !UnwindSafe for HookGuardedTool<'a>
impl<'a> Forget for HookGuardedTool<'a>
impl<'a> Freeze for HookGuardedTool<'a>
impl<'a> Move for HookGuardedTool<'a>
impl<'a> Send for HookGuardedTool<'a>
impl<'a> Sync for HookGuardedTool<'a>where
Arc<ReentrantMutex<RawMutex, RawThreadId, RawLua>>: Sync,
RawVecInner: Sync,
Weak<ReentrantMutex<RawMutex, RawThreadId, RawLua>>: Sync,
Atomic<*mut ()>: Sync,
Mutex<ExecutionBudget>: Sync,
impl<'a> Unpin for HookGuardedTool<'a>
impl<'a> UnsafeUnpin for HookGuardedTool<'a>where
&'a dyn Tool: UnsafeUnpin,
&'a Lua: UnsafeUnpin,
&'a [Hook]: UnsafeUnpin,
&'a Mutex<ExecutionBudget>: UnsafeUnpin,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more