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<ToolId, ToolIdError>
pub fn parse(raw: &str) -> Result<ToolId, ToolIdError>
Parse an untrusted string into a canonical ToolId, failing closed on
anything malformed, oversized, or non-canonical.
Sourcepub fn builtin(runtime_name: &str) -> ToolId
pub fn builtin(runtime_name: &str) -> ToolId
Identity of a capability compiled into this runtime.
Sourcepub fn extension(extension_id: &str, tool_name: &str) -> ToolId
pub fn extension(extension_id: &str, tool_name: &str) -> ToolId
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) -> ToolId
pub fn mcp(server_id: &str, server_tool_name: &str) -> ToolId
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) -> ToolId
pub fn plugin(plugin_id: &str, tool_name: &str) -> ToolId
Identity of a capability declared by a plugin definition.
Sourcepub fn unclassified(runtime_name: &str) -> ToolId
pub fn unclassified(runtime_name: &str) -> ToolId
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
Source§impl Serialize for ToolId
impl Serialize for ToolId
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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<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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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.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> ⓘ
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> ⓘ
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> ThreadSafetyMarker for Twhere
T: Send,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more