Skip to main content

OutcomeExt

Trait OutcomeExt 

Source
pub trait OutcomeExt<T> {
    // Required methods
    fn into_mcp_result(self) -> Result<T, McpError>;
    fn map_ok<U>(self, f: impl FnOnce(T) -> U) -> Outcome<U, McpError>;
}
Expand description

Extension trait for converting Outcomes to MCP-friendly forms.

Required Methods§

Source

fn into_mcp_result(self) -> Result<T, McpError>

Convert an Outcome to a McpResult, mapping Cancelled to RequestCancelled error.

Source

fn map_ok<U>(self, f: impl FnOnce(T) -> U) -> Outcome<U, McpError>

Map the success value, preserving cancellation and panic states.

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.

Implementors§