pub trait IntoToolError {
// Required method
fn tool_err(self, context: impl Display) -> ToolError;
}Expand description
Convenience trait for converting to ToolError with context.
Provides .tool_err() method for easy error conversion with custom messages.
§Example
ⓘ
use turbomcp_core::response::IntoToolError;
fn process() -> Result<(), ToolError> {
some_operation()
.map_err(|e| e.tool_err("Failed to process"))?;
Ok(())
}Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.