Struct 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§

Source§

impl<S, P: Debug> Debug for Request<S, P>
where S: AsRef<str> + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<S, P: Default> Default for Request<S, P>
where S: AsRef<str> + Default,

Source§

fn default() -> Request<S, P>

Returns the “default value” for a type. Read more
Source§

impl<'de, S, P> Deserialize<'de> for Request<S, P>
where S: AsRef<str> + Deserialize<'de>, P: Deserialize<'de>,

Source§

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<S, P: PartialEq> PartialEq for Request<S, P>
where S: AsRef<str> + PartialEq,

Source§

fn eq(&self, other: &Request<S, P>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<S, P> Serialize for Request<S, P>
where S: AsRef<str> + Serialize, P: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<S, P> StructuralPartialEq for Request<S, P>
where S: AsRef<str>,

Auto Trait Implementations§

§

impl<S, P> Freeze for Request<S, P>
where S: Freeze, P: Freeze,

§

impl<S, P> RefUnwindSafe for Request<S, P>

§

impl<S, P> Send for Request<S, P>
where S: Send, P: Send,

§

impl<S, P> Sync for Request<S, P>
where S: Sync, P: Sync,

§

impl<S, P> Unpin for Request<S, P>
where S: Unpin, P: Unpin,

§

impl<S, P> UnwindSafe for Request<S, P>
where S: UnwindSafe, P: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,