TransportHelper

Trait TransportHelper 

Source
pub trait TransportHelper {
    // Provided methods
    fn generate_request_id() -> String { ... }
    fn timeout_future(duration: Duration) -> Sleep { ... }
    fn validate_message(message: &JsonRpcMessage) -> McpResult<()> { ... }
}
Expand description

Helper trait for transport implementations.

This trait provides common functionality that most transport implementations will need, such as message correlation, timeout handling, etc.

Provided Methods§

Source

fn generate_request_id() -> String

Generate a unique request ID.

Source

fn timeout_future(duration: Duration) -> Sleep

Create a timeout future for the given duration.

Source

fn validate_message(message: &JsonRpcMessage) -> McpResult<()>

Validate that a JSON-RPC message is well-formed.

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§