pub struct PlanTool { /* private fields */ }Implementations§
Trait Implementations§
Source§impl Tool for PlanTool
impl Tool for PlanTool
Source§fn needs_approval(&self, _args: &Value) -> bool
fn needs_approval(&self, _args: &Value) -> bool
A plan writes one row in the session’s own store and nothing else, so there is nothing to
ask about. The policy is allow for the same reason; this makes the answer explicit.
Source§fn call<'life0, 'async_trait>(
&'life0 self,
_args: Value,
) -> Pin<Box<dyn Future<Output = Result<String, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn call<'life0, 'async_trait>(
&'life0 self,
_args: Value,
) -> Pin<Box<dyn Future<Output = Result<String, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
A plan belongs to a session and only a run knows which one, so every dispatch arrives
through Self::call_scoped. This form exists because the trait requires it: answering the
question with an empty session would write a plan nobody can find.
fn name(&self) -> &str
fn description(&self) -> &str
Source§fn parameters(&self) -> Value
fn parameters(&self) -> Value
JSON Schema for the arguments object.
Source§fn describe_call(&self, args: &Value) -> String
fn describe_call(&self, args: &Value) -> String
Human-readable one-liner shown when asking for approval.
Source§fn call_scoped<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
args: Value,
scope: &'life1 CallScope<'life2>,
) -> Pin<Box<dyn Future<Output = Result<String, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn call_scoped<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
args: Value,
scope: &'life1 CallScope<'life2>,
) -> Pin<Box<dyn Future<Output = Result<String, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
call for a tool that needs to know which run it is part of: who may be
asked, which session it belongs to, how many children the run has started. Almost no
tool does, so the default ignores the scope.Auto Trait Implementations§
impl Forget for PlanTool
impl Freeze for PlanTool
impl Move for PlanTool
impl RefUnwindSafe for PlanTool
impl Send for PlanTool
impl Sync for PlanTool
impl Unpin for PlanTool
impl UnsafeUnpin for PlanToolwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<Mutex<Option<Db>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<Option<Db>>>>: UnsafeUnpin,
impl UnwindSafe for PlanTool
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