Struct json_rpc2::Request [−][src]
JSON-RPC request.
Implementations
impl Request
[src]
pub fn new(method: &str, params: Option<Value>) -> Self
[src]
Create a new request.
pub fn id(&self) -> &Value
[src]
The id for the request.
pub fn method(&self) -> &str
[src]
The request service method name.
pub fn params(&self) -> &Option<Value>
[src]
The request parameters.
pub fn matches(&self, name: &str) -> bool
[src]
Determine if the given name matches the request method.
pub fn deserialize<T: DeserializeOwned>(&mut self) -> Result<T>
[src]
Deserialize and consume the message parameters into type T
.
If this request message has no parameters or the params
payload cannot be converted to T
this will return
Error::InvalidParams
.
Trait Implementations
impl Clone for Request
[src]
impl Debug for Request
[src]
impl<'de> Deserialize<'de> for Request
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<'a> From<&'a mut Request> for Response
[src]
impl Serialize for Request
[src]
Auto Trait Implementations
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnwindSafe for Request
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,