pub trait TransportDispatcher<R, S, M, OR, OM>: Transport<R, S, M, OR, OM> + McpDispatch<R, OR, M, OM>{ }
Expand description
A composite trait that combines both transport and dispatch capabilities for the MCP protocol.
TransportDispatcher
unifies the functionality of Transport
and McpDispatch
, allowing implementors
to both manage the transport layer and handle message dispatch logic in a single abstraction.
This trait applies to components responsible for the following operations:
- Handle low-level I/O (stream management, payload parsing, lifecycle control)
- Dispatch and route messages, potentially awaiting or sending responses
§Supertraits
Transport<R, S, M, OR, OM>
: Provides the transport-level operations (starting, shutting down, receiving messages, etc.).McpDispatch<R, OR, M, OM>
: Provides message-sending and dispatching capabilities.
§Associated Types
R
: The raw message type expected to be received. Must be deserializable.S
: The message type sent over the transport (often serialized directly to wire).M
: The internal message type used within the dispatcher.OR
: The outbound response type returned from processing a received message.OM
: The outbound message type submitted by clients or application code.