pub struct RpcRequest {
pub id: RpcId,
pub method: String,
pub params: Option<Value>,
}Expand description
The raw JSON-RPC request object, serving as the foundation for RPC routing.
Fields§
§id: RpcId§method: String§params: Option<Value>Implementations§
Source§impl RpcRequest
impl RpcRequest
Source§impl RpcRequest
Custom parser (probably need to be a deserializer)
impl RpcRequest
Custom parser (probably need to be a deserializer)
pub fn from_value(value: Value) -> Result<RpcRequest, RpcRequestParsingError>
Sourcepub fn from_value_with_checks(
value: Value,
checks: RpcRequestCheckFlags,
) -> Result<RpcRequest, RpcRequestParsingError>
pub fn from_value_with_checks( value: Value, checks: RpcRequestCheckFlags, ) -> Result<RpcRequest, RpcRequestParsingError>
Will perform the jsonrpc: "2.0" validation and parse the request.
If this is not desired, using the standard serde_json::from_value would do the parsing
and ignore jsonrpc property.
Trait Implementations§
Source§impl Clone for RpcRequest
impl Clone for RpcRequest
Source§fn clone(&self) -> RpcRequest
fn clone(&self) -> RpcRequest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RpcRequest
impl Debug for RpcRequest
Source§impl<'de> Deserialize<'de> for RpcRequest
impl<'de> Deserialize<'de> for RpcRequest
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 From<RpcRequest> for RpcNotification
impl From<RpcRequest> for RpcNotification
Source§fn from(request: RpcRequest) -> Self
fn from(request: RpcRequest) -> Self
Converts to this type from the input type.
Source§impl Serialize for RpcRequest
impl Serialize for RpcRequest
Source§impl TryFrom<Value> for RpcRequest
Convenient TryFrom, and will execute the Request::from_value,
which will perform the version validation.
impl TryFrom<Value> for RpcRequest
Convenient TryFrom, and will execute the Request::from_value, which will perform the version validation.
Source§type Error = RpcRequestParsingError
type Error = RpcRequestParsingError
The type returned in the event of a conversion error.
Source§fn try_from(value: Value) -> Result<RpcRequest, RpcRequestParsingError>
fn try_from(value: Value) -> Result<RpcRequest, RpcRequestParsingError>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for RpcRequest
impl RefUnwindSafe for RpcRequest
impl Send for RpcRequest
impl Sync for RpcRequest
impl Unpin for RpcRequest
impl UnwindSafe for RpcRequest
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