pub struct Request<M> { /* private fields */ }Expand description
JSON-RPC Request object
Implementations§
Source§impl<'a, M> Request<M>where
M: Serialize + Deserialize<'a>,
impl<'a, M> Request<M>where
M: Serialize + Deserialize<'a>,
Sourcepub fn new0(method: M) -> Request<M>
pub fn new0(method: M) -> Request<M>
Create a new Request object with the given method with no ID (no response expected)
Sourcepub fn new(id: Id, method: M) -> Request<M>
pub fn new(id: Id, method: M) -> Request<M>
Create a new Request object with the given method and ID
Sourcepub fn into_parts(self) -> (Option<Id>, M)
pub fn into_parts(self) -> (Option<Id>, M)
Split the Request object into its parts (useful for 3rd party serialization)
Sourcepub fn from_parts(id: Option<Id>, method: M) -> Request<M>
pub fn from_parts(id: Option<Id>, method: M) -> Request<M>
Combine the parts into a Request object (useful for 3rd party de-serialization)
Trait Implementations§
Source§impl<'de, M> Deserialize<'de> for Request<M>where
M: Deserialize<'de>,
impl<'de, M> Deserialize<'de> for Request<M>where
M: Deserialize<'de>,
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<M: DeserializeOwned + Serialize> TryFrom<QueryString> for Request<M>
impl<M: DeserializeOwned + Serialize> TryFrom<QueryString> for Request<M>
Auto Trait Implementations§
impl<M> Freeze for Request<M>where
M: Freeze,
impl<M> RefUnwindSafe for Request<M>where
M: RefUnwindSafe,
impl<M> Send for Request<M>where
M: Send,
impl<M> Sync for Request<M>where
M: Sync,
impl<M> Unpin for Request<M>where
M: Unpin,
impl<M> UnsafeUnpin for Request<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for Request<M>where
M: 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