Struct cubist_proxy::JrpcRequest
source · pub struct JrpcRequest {
pub jsonrpc: V2_0,
pub method: String,
pub params: Option<Value>,
pub id: IdReq,
}
Expand description
A rpc call is represented by sending a Request object to a Server.
See the parameters for details.
Fields§
§jsonrpc: V2_0
A String specifying the version of the JSON-RPC protocol. MUST be exactly “2.0”.
method: String
A serializable method.
The spec states it must be a String containing the name of the method to be invoked. This
library makes no guarantees about this. It is recomended to use a simple enum
for your
library’s method
.
Section 8: Extensions
Method names that begin with "rpc."
are reserved for system extensions, and MUST NOT be
used for anything else. Each system extension is defined in a related specification. All
system extensions are OPTIONAL.
This library provides no way of checking for system extensions.
params: Option<Value>
A Structured value that holds the parameter values to be used during the invocation of the method.
Spec Requirement
Note: the following spec is not upheld by this library.
If present, parameters for the rpc call MUST be provided as a Structured value. Either by-position through an Array or by-name through an Object.
- by-position: params MUST be an Array, containing the values in the Server expected order.
- by-name: params MUST be an Object, with member names that match the Server expected parameter names. The absence of expected names MAY result in an error being generated. The names MUST match exactly, including case, to the method’s expected parameters.
id: IdReq
The id
. See Id
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Request
impl<'de> Deserialize<'de> for Request
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>,
source§impl PartialEq<Request> for Request
impl PartialEq<Request> for Request
impl Eq for Request
impl StructuralEq for Request
impl StructuralPartialEq for Request
Auto Trait Implementations§
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnwindSafe for Request
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.