pub struct Request {
pub jsonrpc: String,
pub method: String,
pub params: Option<Value>,
pub id: Option<RequestId>,
pub correlation_id: Option<String>,
}Expand description
JSON-RPC 2.0 request message
Fields§
§jsonrpc: String§method: String§params: Option<Value>§id: Option<RequestId>§correlation_id: Option<String>Implementations§
Source§impl Request
impl Request
Sourcepub fn with_params(self, params: Value) -> Self
pub fn with_params(self, params: Value) -> Self
Add parameters to the request
Sourcepub fn expects_response(&self) -> bool
pub fn expects_response(&self) -> bool
Check if this request expects a response
Sourcepub fn is_notification(&self) -> bool
pub fn is_notification(&self) -> bool
Check if this is a notification (no response expected)
Sourcepub fn take_params(self) -> Option<Value>
pub fn take_params(self) -> Option<Value>
Take ownership of the parameters
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnwindSafe for Request
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