Struct json_rpc_types::Request [−][src]
pub struct Request<P, T = StrBuf<32>> { pub jsonrpc: Version, pub method: T, pub params: Option<P>, pub id: Option<Id>, }
Request representation.
Note that omitting id means that request is notification, rather than call, which expects
response.
This can be used to indicate lack of interest in response.
Type parameters:
P- to specify type ofparamsfield, which is optional. Normally it should be collection of values or object. But choice is yours.T- specifies textual type. By default it uses static buffer of 32 bytes, which is more than enough in normal cases.
Fields
jsonrpc: VersionA String specifying the version of the JSON-RPC protocol.
method: TA String containing the name of the method to be invoked
By default is static buffer of 32 bytes.
params: Option<P>A Structured value that holds the parameter values to be used during the invocation of the method
id: Option<Id>An identifier established by the Client.
If not present, request is notification to which there should be no response.
Implementations
impl<P, T> Request<P, T>[src]
pub const fn is_notification(&self) -> bool[src]
Returns whether request is notification.
Trait Implementations
impl<P: Clone, T: Clone> Clone for Request<P, T>[src]
impl<P: Debug, T: Debug> Debug for Request<P, T>[src]
impl<'de, P, T> Deserialize<'de> for Request<P, T> where
P: Deserialize<'de>,
T: Deserialize<'de>, [src]
P: Deserialize<'de>,
T: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
impl<P: PartialEq, T: PartialEq> PartialEq<Request<P, T>> for Request<P, T>[src]
impl<P, T> Serialize for Request<P, T> where
P: Serialize,
T: Serialize, [src]
P: Serialize,
T: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer, [src]
__S: Serializer,
impl<P, T> StructuralPartialEq for Request<P, T>[src]
Auto Trait Implementations
impl<P, T> RefUnwindSafe for Request<P, T> where
P: RefUnwindSafe,
T: RefUnwindSafe,
P: RefUnwindSafe,
T: RefUnwindSafe,
impl<P, T> Send for Request<P, T> where
P: Send,
T: Send,
P: Send,
T: Send,
impl<P, T> Sync for Request<P, T> where
P: Sync,
T: Sync,
P: Sync,
T: Sync,
impl<P, T> Unpin for Request<P, T> where
P: Unpin,
T: Unpin,
P: Unpin,
T: Unpin,
impl<P, T> UnwindSafe for Request<P, T> where
P: UnwindSafe,
T: UnwindSafe,
P: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,