pub struct JsonRpcRequest<P = Value> {
pub jsonrpc: Version,
pub id: RequestId,
pub method: String,
pub params: Option<P>,
}Expand description
A JSON-RPC 2.0 request envelope.
P is the method-specific parameter type. Concrete callers use a
{Method}Params struct from crate::types; generic callers (the server
dispatch, proxies, middleware) use serde_json::Value.
Fields§
§jsonrpc: VersionProtocol version; serializes to the literal "2.0".
id: RequestIdCorrelation id. Echoed unchanged in the response.
method: StringThe method name (e.g. "dig.getContent").
params: Option<P>Method-specific parameters. Absent for methods that take none.
Implementations§
Trait Implementations§
Source§impl<P: Clone> Clone for JsonRpcRequest<P>
impl<P: Clone> Clone for JsonRpcRequest<P>
Source§fn clone(&self) -> JsonRpcRequest<P>
fn clone(&self) -> JsonRpcRequest<P>
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<P: Debug> Debug for JsonRpcRequest<P>
impl<P: Debug> Debug for JsonRpcRequest<P>
Source§impl<'de, P> Deserialize<'de> for JsonRpcRequest<P>where
P: Deserialize<'de> + Default,
impl<'de, P> Deserialize<'de> for JsonRpcRequest<P>where
P: Deserialize<'de> + 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<P: PartialEq> PartialEq for JsonRpcRequest<P>
impl<P: PartialEq> PartialEq for JsonRpcRequest<P>
Source§impl<P> Serialize for JsonRpcRequest<P>where
P: Serialize,
impl<P> Serialize for JsonRpcRequest<P>where
P: Serialize,
impl<P: PartialEq> StructuralPartialEq for JsonRpcRequest<P>
Auto Trait Implementations§
impl<P> Freeze for JsonRpcRequest<P>where
P: Freeze,
impl<P> RefUnwindSafe for JsonRpcRequest<P>where
P: RefUnwindSafe,
impl<P> Send for JsonRpcRequest<P>where
P: Send,
impl<P> Sync for JsonRpcRequest<P>where
P: Sync,
impl<P> Unpin for JsonRpcRequest<P>where
P: Unpin,
impl<P> UnsafeUnpin for JsonRpcRequest<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for JsonRpcRequest<P>where
P: UnwindSafe,
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