pub trait RequestRouter: Send + Sync {
// Required method
async fn route(
&self,
method: &str,
params: Option<&Value>,
ctx: &Context<'_>,
) -> Result<Value, McpError>;
}Expand description
Trait for routing requests to handlers.
This trait is implemented by Server with different bounds depending on which handlers are registered.
Required Methods§
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.