pub struct Shell { /* private fields */ }Trait Implementations§
Source§impl Tool for Shell
impl Tool for Shell
Source§fn needs_approval(&self, args: &Value) -> bool
fn needs_approval(&self, args: &Value) -> bool
Only work that cannot be undone asks a person anything. ls, cargo test, a commit, a
file written inside the workspace: those are the job, and a prompt for each of them trains
the answer y that a rm -rf then arrives on top of. See crate::risk for the list.
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.
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,
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 Shell
impl Freeze for Shellwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Root>: Freeze,
PhantomData<String>: Freeze,
PhantomData<PathBuf>: Freeze,
impl Move for Shell
impl RefUnwindSafe for Shell
impl Send for Shellwhere
RawVecInner: Send,
impl Sync for Shellwhere
RawVecInner: Sync,
impl Unpin for Shell
impl UnsafeUnpin for Shellwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Root>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<PathBuf>: UnsafeUnpin,
impl UnwindSafe for Shellwhere
RawVecInner: 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