pub enum PluginToolSpec {
Wasm(WasmToolSpec),
Script(ScriptToolSpec),
Mcp(McpToolSpec),
}Expand description
One tool line in plugin.json (the form is decided by form).
Form exclusivity (wasm without run/server, script without
module/server/capabilities, mcp without
module/run/capabilities/parameters/description) is enforced by each form
struct’s deny_unknown_fields.
Variants§
Wasm(WasmToolSpec)
In-process WASM sandbox (WIT phi:tool@0.1.0).
Script(ScriptToolSpec)
argv-spawned script.
Mcp(McpToolSpec)
In-package MCP server (the answer for multi-language).
Implementations§
Source§impl PluginToolSpec
impl PluginToolSpec
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
The name field in the manifest (wasm/script = tool name; mcp = server
label).
Sourcepub fn timeout_secs(&self) -> Option<u64>
pub fn timeout_secs(&self) -> Option<u64>
Timeout (seconds); None if unset (the runtime uses the form’s default).
Sourcepub fn identity(&self, plugin_name: &str) -> Result<String, IdentityError>
pub fn identity(&self, plugin_name: &str) -> Result<String, IdentityError>
Identity key. For wasm/script it is directly plugin.{plugin}.{name};
for the mcp form the entry name is a server label, and the real tool keys
are generated at load time from the server’s tool names — the label key
returned here is only used for de-duplication within the manifest and
review annotations.
Trait Implementations§
Source§impl Clone for PluginToolSpec
impl Clone for PluginToolSpec
Source§impl Debug for PluginToolSpec
impl Debug for PluginToolSpec
Source§impl<'de> Deserialize<'de> for PluginToolSpec
impl<'de> Deserialize<'de> for PluginToolSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for PluginToolSpec
Source§impl PartialEq for PluginToolSpec
impl PartialEq for PluginToolSpec
Source§impl Serialize for PluginToolSpec
impl Serialize for PluginToolSpec
impl StructuralPartialEq for PluginToolSpec
Auto Trait Implementations§
impl Forget for PluginToolSpec
impl Freeze for PluginToolSpec
impl RefUnwindSafe for PluginToolSpec
impl Send for PluginToolSpec
impl Sync for PluginToolSpec
impl Unpin for PluginToolSpec
impl UnsafeUnpin for PluginToolSpec
impl UnwindSafe for PluginToolSpec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.