pub struct ToolName(/* private fields */);Expand description
Tool name identifier (newtype over String).
Represents the name of an MCP tool. Using a strong type ensures tool names are not confused with other string values.
§Examples
use mcp_execution_core::ToolName;
let tool = ToolName::new("execute_code");
assert_eq!(tool.as_str(), "execute_code");Implementations§
Source§impl ToolName
impl ToolName
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
Creates a new tool name.
§Examples
use mcp_execution_core::ToolName;
let name = ToolName::new("my_tool");
assert_eq!(name.as_str(), "my_tool");Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Returns the tool name as a string slice.
§Examples
use mcp_execution_core::ToolName;
let name = ToolName::new("test_tool");
assert_eq!(name.as_str(), "test_tool");Sourcepub fn into_inner(self) -> String
pub fn into_inner(self) -> String
Consumes the ToolName and returns the inner String.
§Examples
use mcp_execution_core::ToolName;
let name = ToolName::new("tool");
let inner: String = name.into_inner();
assert_eq!(inner, "tool");Trait Implementations§
Source§impl<'de> Deserialize<'de> for ToolName
impl<'de> Deserialize<'de> for ToolName
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ToolName
impl StructuralPartialEq for ToolName
Auto Trait Implementations§
impl Freeze for ToolName
impl RefUnwindSafe for ToolName
impl Send for ToolName
impl Sync for ToolName
impl Unpin for ToolName
impl UnwindSafe for ToolName
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