pub trait IntoToolError {
// Required method
fn into_tool_error(self) -> ToolError;
}Expand description
将已知错误类型转换为 ToolError。
设计原则: 不使用 blanket impl(impl<E: Display>),避免吞掉 ToolError 原始分类。
只为核心错误类型提供显式实现。
已有实现:
ToolError→ 直接透传std::io::Error→Externalserde_json::Error→Internalanyhow::Error→External(需anyhowfeature)
Required Methods§
fn into_tool_error(self) -> ToolError
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl IntoToolError for Error
std::io::Error → External
impl IntoToolError for Error
std::io::Error → External
fn into_tool_error(self) -> ToolError
Source§impl IntoToolError for Error
serde_json::Error → Internal
impl IntoToolError for Error
serde_json::Error → Internal
fn into_tool_error(self) -> ToolError
Implementors§
impl IntoToolError for ToolError
ToolError → 直接透传,不包装