Skip to main content

McpHandler

Trait McpHandler 

Source
pub trait McpHandler:
    Send
    + Sync
    + 'static {
    // Required method
    fn handle(&self, request: Request) -> impl Future<Output = Response> + Send;
}
Expand description

Handler for inbound server_request frames on a streaming WS.

One handler instance is bound at create_streaming time and stays live for the lifetime of the WS session. Implementations must be Send + Sync + 'static since the demux task that invokes them is spawned.

Required Methods§

Source

fn handle(&self, request: Request) -> impl Future<Output = Response> + Send

Dispatch a single request. The returned Response’s id must echo request.id so the API can correlate the reply to the in-flight proxy request waiting on it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§