pub struct ToolId(/* private fields */);Expand description
Stable, validated capability identity of the form namespace:name
(e.g. builtin:bash, mcp.server-1:list_issues).
Only canonical lowercase segments of [a-z0-9_.-] starting with an
alphanumeric character are accepted, which removes case/sanitization
alias ambiguity by construction.
Implementations§
Source§impl ToolId
impl ToolId
Sourcepub fn parse(raw: &str) -> Result<Self, ToolIdError>
pub fn parse(raw: &str) -> Result<Self, ToolIdError>
Parse an untrusted string into a canonical ToolId, failing closed on
anything malformed, oversized, or non-canonical.
Sourcepub fn builtin(runtime_name: &str) -> Self
pub fn builtin(runtime_name: &str) -> Self
Identity of a capability compiled into this runtime.
Sourcepub fn extension(extension_id: &str, tool_name: &str) -> Self
pub fn extension(extension_id: &str, tool_name: &str) -> Self
Identity of a capability declared by a locally installed extension. The extension id and tool name are encoded independently, so existing uppercase/Unicode/colon-bearing runtime identities are representable exactly without alias collapse.
Sourcepub fn mcp(server_id: &str, server_tool_name: &str) -> Self
pub fn mcp(server_id: &str, server_tool_name: &str) -> Self
Identity of a capability served by a configured MCP server, keyed by the server id and the tool name as the server knows it.
Sourcepub fn plugin(plugin_id: &str, tool_name: &str) -> Self
pub fn plugin(plugin_id: &str, tool_name: &str) -> Self
Identity of a capability declared by a plugin definition.
Sourcepub fn unclassified(runtime_name: &str) -> Self
pub fn unclassified(runtime_name: &str) -> Self
Identity of a dynamically registered capability with no declared
origin. Kept in an explicit unknown namespace so it can never be
mistaken for a trusted builtin.
pub fn as_str(&self) -> &str
Trait Implementations§
impl Eq for ToolId
Source§impl Ord for ToolId
impl Ord for ToolId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for ToolId
impl PartialOrd for ToolId
impl StructuralPartialEq for ToolId
Auto Trait Implementations§
impl Freeze for ToolId
impl RefUnwindSafe for ToolId
impl Send for ToolId
impl Sync for ToolId
impl Unpin for ToolId
impl UnsafeUnpin for ToolId
impl UnwindSafe for ToolId
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.