pub struct JsonRpcRequest {
pub jsonrpc: String,
pub id: Value,
pub method: String,
pub params: Value,
}Expand description
One JSON-RPC 2.0 request, as read line-by-line off stdin.
Fields§
§jsonrpc: StringProtocol version marker; "2.0" for every client we speak to.
id: ValueRequest id to echo back in the response. JSON-RPC allows a
string, a number or null here, so it stays an opaque
serde_json::Value rather than committing to one shape.
method: StringThe method being invoked — initialize, tools/list,
tools/call, …
params: ValueMethod parameters. Defaults to Value::Null because clients may
omit the field entirely for parameterless methods.
Trait Implementations§
Source§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 UnsafeUnpin 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