pub struct JsonRpcLayer { /* private fields */ }Expand description
Tower layer that adds JSON-RPC 2.0 framing to an MCP service.
This is the standard way to compose JsonRpcService with other tower
middleware via ServiceBuilder.
§Example
use tower::ServiceBuilder;
use tower_mcp::{McpRouter, JsonRpcLayer, JsonRpcService};
let router = McpRouter::new().server_info("my-server", "1.0.0");
// Compose with ServiceBuilder
let service = ServiceBuilder::new()
.layer(JsonRpcLayer::new())
.service(router);Implementations§
Source§impl JsonRpcLayer
impl JsonRpcLayer
Trait Implementations§
Source§impl Clone for JsonRpcLayer
impl Clone for JsonRpcLayer
Source§fn clone(&self) -> JsonRpcLayer
fn clone(&self) -> JsonRpcLayer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for JsonRpcLayer
impl Debug for JsonRpcLayer
Source§impl Default for JsonRpcLayer
impl Default for JsonRpcLayer
Source§fn default() -> JsonRpcLayer
fn default() -> JsonRpcLayer
Returns the “default value” for a type. Read more
Source§impl<S> Layer<S> for JsonRpcLayer
impl<S> Layer<S> for JsonRpcLayer
impl Copy for JsonRpcLayer
Auto Trait Implementations§
impl Freeze for JsonRpcLayer
impl RefUnwindSafe for JsonRpcLayer
impl Send for JsonRpcLayer
impl Sync for JsonRpcLayer
impl Unpin for JsonRpcLayer
impl UnwindSafe for JsonRpcLayer
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