Enum JsonRpcFrame
pub enum JsonRpcFrame {
Request(JsonRpcRequest),
Response {
id: Value,
result: Result<Value, JsonRpcError>,
},
}Expand description
A validated inbound JSON-RPC 2.0 frame.
Variants§
Implementations§
Source§impl JsonRpcFrame
impl JsonRpcFrame
Sourcepub fn from_value(value: Value) -> Result<Self, JsonRpcFrameError>
pub fn from_value(value: Value) -> Result<Self, JsonRpcFrameError>
Validate a syntactically valid JSON value while retaining the direction needed by transports to handle malformed envelopes safely.
Trait Implementations§
Source§impl Debug for JsonRpcFrame
impl Debug for JsonRpcFrame
Source§impl<'de> Deserialize<'de> for JsonRpcFrame
impl<'de> Deserialize<'de> for JsonRpcFrame
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 JsonRpcFrame
impl RefUnwindSafe for JsonRpcFrame
impl Send for JsonRpcFrame
impl Sync for JsonRpcFrame
impl Unpin for JsonRpcFrame
impl UnsafeUnpin for JsonRpcFrame
impl UnwindSafe for JsonRpcFrame
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