Skip to main content

IntoToolError

Trait IntoToolError 

Source
pub trait IntoToolError {
    // Required method
    fn into_tool_error(self) -> ToolError;
}
Expand description

将已知错误类型转换为 ToolError

设计原则: 不使用 blanket impl(impl<E: Display>),避免吞掉 ToolError 原始分类。 只为核心错误类型提供显式实现。

已有实现:

  • ToolError → 直接透传
  • std::io::ErrorExternal
  • serde_json::ErrorInternal
  • anyhow::ErrorExternal(需 anyhow feature)

Required Methods§

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::ErrorExternal

Source§

impl IntoToolError for Error

serde_json::ErrorInternal

Implementors§

Source§

impl IntoToolError for ToolError

ToolError → 直接透传,不包装