pub struct WorkspaceToolRuntime { /* private fields */ }Available on non-
target_family=wasm only.Expand description
Retained canonical workspace-tool runtime.
Shell processes and interactive sessions live for the lifetime of this
value, so a later write_stdin call can address a session created by
exec_command.
Implementations§
Source§impl WorkspaceToolRuntime
impl WorkspaceToolRuntime
Sourcepub fn new(workspace: PathBuf) -> Self
pub fn new(workspace: PathBuf) -> Self
Creates a runtime rooted at workspace with a sanitized guest process
environment.
Sourcepub async fn execute_tool(
&self,
name: &str,
input: ToolInput,
context: ToolContext<'_>,
) -> ToolOutput
pub async fn execute_tool( &self, name: &str, input: ToolInput, context: ToolContext<'_>, ) -> ToolOutput
Executes one canonical workspace tool through retained runtime state.
Sourcepub fn control(&self) -> WorkspaceToolRuntimeControl
pub fn control(&self) -> WorkspaceToolRuntimeControl
Returns cancellation and shutdown control for retained subprocesses.
Auto Trait Implementations§
impl !RefUnwindSafe for WorkspaceToolRuntime
impl !UnwindSafe for WorkspaceToolRuntime
impl Freeze for WorkspaceToolRuntime
impl Send for WorkspaceToolRuntime
impl Sync for WorkspaceToolRuntime
impl Unpin for WorkspaceToolRuntime
impl UnsafeUnpin for WorkspaceToolRuntime
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.