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§
Sourcefn generate_request_id() -> String
fn generate_request_id() -> String
Generate a unique request ID.
Sourcefn timeout_future(duration: Duration) -> Sleep
fn timeout_future(duration: Duration) -> Sleep
Create a timeout future for the given duration.
Sourcefn validate_message(message: &JsonRpcMessage) -> McpResult<()>
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.