pub struct JsonRpcRequest {
pub jsonrpc: String,
pub id: Value,
pub method: String,
pub params: Option<Value>,
}
Expand description
A JSON-RPC request
Fields§
§jsonrpc: String
JSON-RPC protocol version
id: Value
Request ID
method: String
Method name
params: Option<Value>
Method parameters
Implementations§
Source§impl JsonRpcRequest
impl JsonRpcRequest
Sourcepub fn new(
id: impl Into<Value>,
method: impl Into<String>,
params: Option<Value>,
) -> Self
pub fn new( id: impl Into<Value>, method: impl Into<String>, params: Option<Value>, ) -> Self
Create a new JSON-RPC request
Sourcepub fn list_tools(id: impl Into<Value>) -> Self
pub fn list_tools(id: impl Into<Value>) -> Self
Create a request to list MCP tools
Sourcepub fn call_tool(
id: impl Into<Value>,
name: impl Into<String>,
args: Value,
) -> Self
pub fn call_tool( id: impl Into<Value>, name: impl Into<String>, args: Value, ) -> Self
Create a request to call an MCP tool
Sourcepub fn list_resources(id: impl Into<Value>) -> Self
pub fn list_resources(id: impl Into<Value>) -> Self
Create a request to list MCP resources
Trait Implementations§
Source§impl Clone for JsonRpcRequest
impl Clone for JsonRpcRequest
Source§fn clone(&self) -> JsonRpcRequest
fn clone(&self) -> JsonRpcRequest
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 JsonRpcRequest
impl Debug for JsonRpcRequest
Source§impl<'de> Deserialize<'de> for JsonRpcRequest
impl<'de> Deserialize<'de> for JsonRpcRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for JsonRpcRequest
impl RefUnwindSafe for JsonRpcRequest
impl Send for JsonRpcRequest
impl Sync for JsonRpcRequest
impl Unpin for JsonRpcRequest
impl UnwindSafe for JsonRpcRequest
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