pub struct ScriptPlugin { /* private fields */ }Expand description
A concrete Plugin implementation that executes external scripts.
Each tool declared in the plugin’s plugin.toml maps to a script file
in the plugin directory. The script receives input as the ROBOTICUS_INPUT
environment variable (JSON) and should write its output to stdout.
Implementations§
Source§impl ScriptPlugin
impl ScriptPlugin
pub fn new(manifest: PluginManifest, dir: PathBuf) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
pub fn has_script(&self, tool_name: &str) -> bool
pub fn script_path(&self, tool_name: &str) -> Option<&Path>
pub fn script_count(&self) -> usize
pub fn is_tool_dangerous(&self, tool_name: &str) -> bool
pub fn manifest(&self) -> &PluginManifest
Trait Implementations§
Source§impl Plugin for ScriptPlugin
impl Plugin for ScriptPlugin
fn name(&self) -> &str
fn version(&self) -> &str
fn tools(&self) -> Vec<ToolDef>
fn init<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute_tool<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
input: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<ToolResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn shutdown<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl Freeze for ScriptPlugin
impl RefUnwindSafe for ScriptPlugin
impl Send for ScriptPlugin
impl Sync for ScriptPlugin
impl Unpin for ScriptPlugin
impl UnsafeUnpin for ScriptPlugin
impl UnwindSafe for ScriptPlugin
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