pub struct McpRequest {
pub id: Option<String>,
pub jsonrpc: String,
pub method: String,
pub params: BTreeMap<String, Value>,
}Expand description
A JSON-RPC 2.0 request to the streamable MCP endpoint.
Models the contract’s MCPRequest schema.
Fields§
§id: Option<String>ID correlates a response with this request. None is a notification,
and is omitted from the wire rather than sent as an empty string —
JSON-RPC reads a present id as “answer me”, so a notification that
carried one would not be a notification.
jsonrpc: StringThe protocol version, always “2.0”.
method: StringThe MCP method being invoked, such as tools/call.
params: BTreeMap<String, Value>The method’s arguments.
Trait Implementations§
Source§impl Clone for McpRequest
impl Clone for McpRequest
Source§fn clone(&self) -> McpRequest
fn clone(&self) -> McpRequest
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 ContractModel for McpRequest
impl ContractModel for McpRequest
Source§impl Debug for McpRequest
impl Debug for McpRequest
Source§impl Default for McpRequest
impl Default for McpRequest
Source§fn default() -> McpRequest
fn default() -> McpRequest
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for McpRequestwhere
McpRequest: Default,
impl<'de> Deserialize<'de> for McpRequestwhere
McpRequest: Default,
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 PartialEq for McpRequest
impl PartialEq for McpRequest
Source§impl Serialize for McpRequest
impl Serialize for McpRequest
impl StructuralPartialEq for McpRequest
Auto Trait Implementations§
impl Freeze for McpRequest
impl RefUnwindSafe for McpRequest
impl Send for McpRequest
impl Sync for McpRequest
impl Unpin for McpRequest
impl UnsafeUnpin for McpRequest
impl UnwindSafe for McpRequest
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