Struct jsonrpc_rs::Request

source ·
pub struct Request<S, P>where
    S: AsRef<str>,
{ pub id: Option<usize>, pub jsonrpc: Version, pub method: S, pub params: P, }
Expand description

A rpc call is represented by sending a Request object to a Server.

visit here for details

Fields§

§id: Option<usize>

An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null and Numbers SHOULD NOT contain fractional parts

§jsonrpc: Version

A String specifying the version of the JSON-RPC protocol. MUST be exactly “2.0”.

§method: S

A String containing the name of the method to be invoked. Method names that begin with the word rpc followed by a period character (U+002E or ASCII 46) are reserved for rpc-internal methods and extensions and MUST NOT be used for anything else

§params: P

A Structured value that holds the parameter values to be used during the invocation of the method. This member MAY be omitted.

Trait Implementations§

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.