Struct rpc_router::Request
source · pub struct Request {
pub id: Value,
pub method: String,
pub params: Option<Value>,
}
Expand description
The raw JSON-RPC request object, serving as the foundation for RPC routing.
Fields§
§id: Value
§method: String
§params: Option<Value>
Implementations§
source§impl Request
impl Request
sourcepub fn from_value(value: Value) -> Result<Request, RequestParsingError>
pub fn from_value(value: Value) -> Result<Request, RequestParsingError>
Will perform the jsonrpc: "2.0"
validation.
If this is not desired, using the standard serde_json::from_value
would do the parsing
and ignore jsonrpc
property.
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