pub struct X402McpRequest {
pub id: Option<X402McpRequestId>,
pub jsonrpc: X402McpRequestJsonrpc,
pub method: String,
pub params: Map<String, Value>,
}Expand description
A JSON-RPC 2.0 request for the Model Context Protocol.
JSON schema
{
"description": "A JSON-RPC 2.0 request for the Model Context Protocol.",
"type": "object",
"required": [
"jsonrpc",
"method"
],
"properties": {
"id": {
"description": "Request identifier.",
"examples": [
1
],
"oneOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"jsonrpc": {
"description": "JSON-RPC version, must be \"2.0\".",
"examples": [
"2.0"
],
"type": "string",
"enum": [
"2.0"
]
},
"method": {
"description": "The MCP method to invoke.",
"examples": [
"tools/list"
],
"type": "string"
},
"params": {
"description": "Optional parameters for the method.",
"examples": [
{}
],
"type": "object",
"additionalProperties": true
}
}
}Fields§
§id: Option<X402McpRequestId>Request identifier.
jsonrpc: X402McpRequestJsonrpcJSON-RPC version, must be “2.0”.
method: StringThe MCP method to invoke.
params: Map<String, Value>Optional parameters for the method.
Implementations§
Source§impl X402McpRequest
impl X402McpRequest
pub fn builder() -> X402McpRequest
Trait Implementations§
Source§impl Clone for X402McpRequest
impl Clone for X402McpRequest
Source§fn clone(&self) -> X402McpRequest
fn clone(&self) -> X402McpRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 X402McpRequest
impl Debug for X402McpRequest
Source§impl<'de> Deserialize<'de> for X402McpRequest
impl<'de> Deserialize<'de> for X402McpRequest
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
Source§impl From<&X402McpRequest> for X402McpRequest
impl From<&X402McpRequest> for X402McpRequest
Source§fn from(value: &X402McpRequest) -> Self
fn from(value: &X402McpRequest) -> Self
Converts to this type from the input type.
Source§impl From<X402McpRequest> for X402McpRequest
impl From<X402McpRequest> for X402McpRequest
Source§fn from(value: X402McpRequest) -> Self
fn from(value: X402McpRequest) -> Self
Converts to this type from the input type.
Source§impl Serialize for X402McpRequest
impl Serialize for X402McpRequest
Source§impl TryFrom<X402McpRequest> for X402McpRequest
impl TryFrom<X402McpRequest> for X402McpRequest
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: X402McpRequest) -> Result<Self, ConversionError>
fn try_from(value: X402McpRequest) -> Result<Self, ConversionError>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for X402McpRequest
impl RefUnwindSafe for X402McpRequest
impl Send for X402McpRequest
impl Sync for X402McpRequest
impl Unpin for X402McpRequest
impl UnsafeUnpin for X402McpRequest
impl UnwindSafe for X402McpRequest
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