pub struct MessageRouter { /* private fields */ }Expand description
Message router for dispatching MCP messages to handlers
Implementations§
Source§impl MessageRouter
impl MessageRouter
Sourcepub fn new(handler: Arc<dyn MessageHandler>) -> MessageRouter
pub fn new(handler: Arc<dyn MessageHandler>) -> MessageRouter
Create a new message router with the given handler
Sourcepub async fn route_message(
&self,
message: JsonRpcMessage,
) -> Result<Option<JsonRpcMessage>, Error>
pub async fn route_message( &self, message: JsonRpcMessage, ) -> Result<Option<JsonRpcMessage>, Error>
Route a JSON-RPC message to the appropriate handler
Auto Trait Implementations§
impl !RefUnwindSafe for MessageRouter
impl !UnwindSafe for MessageRouter
impl Freeze for MessageRouter
impl Send for MessageRouter
impl Sync for MessageRouter
impl Unpin for MessageRouter
impl UnsafeUnpin for MessageRouter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more