pub struct WorkspaceTools { /* private fields */ }Expand description
Tools bound to one worktree.
Implementations§
Source§impl WorkspaceTools
impl WorkspaceTools
Sourcepub fn new(root: &Path, policy: Policy) -> Result<Self>
pub fn new(root: &Path, policy: Policy) -> Result<Self>
Tools for the worktree at root under policy.
Sourcepub fn with_env(self, env: Vec<(String, String)>) -> Self
pub fn with_env(self, env: Vec<(String, String)>) -> Self
Commands also get env (the policy’s own variables still win).
Sourcepub fn with_runner(self, runner: Runner) -> Self
pub fn with_runner(self, runner: Runner) -> Self
Runs commands with runner (the sandbox).
Trait Implementations§
Source§impl Clone for WorkspaceTools
impl Clone for WorkspaceTools
Source§impl Debug for WorkspaceTools
impl Debug for WorkspaceTools
Source§impl ToolClient for WorkspaceTools
impl ToolClient for WorkspaceTools
Source§fn destination(&self, _tool: &ToolId) -> Destination
fn destination(&self, _tool: &ToolId) -> Destination
The tools touch only the local worktree. (A command the model runs may still use the network; that is the policy’s and, in M6, the sandbox’s concern, not a transport this client opens.)
Source§fn call<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tool: &'life1 ToolId,
arguments: &'life2 Value,
_provenance: Option<&'life3 Provenance>,
) -> Pin<Box<dyn Future<Output = Result<Value, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn call<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tool: &'life1 ToolId,
arguments: &'life2 Value,
_provenance: Option<&'life3 Provenance>,
) -> Pin<Box<dyn Future<Output = Result<Value, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Invoke a tool and return its result. Read more
Auto Trait Implementations§
impl Freeze for WorkspaceTools
impl RefUnwindSafe for WorkspaceTools
impl Send for WorkspaceTools
impl Sync for WorkspaceTools
impl Unpin for WorkspaceTools
impl UnsafeUnpin for WorkspaceTools
impl UnwindSafe for WorkspaceTools
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 moreCreates a shared type from an unshared type.