pub trait RequestRouter: Send + Sync {
// Required methods
fn server_info(&self) -> ServerInfo;
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§
Sourcefn server_info(&self) -> ServerInfo
fn server_info(&self) -> ServerInfo
Get the server info.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".