pub enum MessageType {
Request(JsonRpcRequest),
Response(JsonRpcResponse),
Notification(JsonRpcNotification),
}Expand description
Classification of a JSON-RPC 2.0 frame.
Emitted by MessageBuilder::parse_message to let callers dispatch
on the three fundamental flavours of traffic in a JSON-RPC session.
Variants§
Request(JsonRpcRequest)
Outbound request frame — method, params, and a numeric id.
Never produced by MessageBuilder::parse_message; reserved
for code paths that construct requests via RequestBuilder
and want to round-trip them through the same enum.
Response(JsonRpcResponse)
Inbound reply frame correlated with a previously-sent request
via a shared numeric id. Carries either a result or an
error payload (never both).
Notification(JsonRpcNotification)
Server-initiated push frame. Has a method and params like a
request but no id, so it expects no reply. Examples:
subscription updates, heartbeats.
Trait Implementations§
Source§impl Clone for MessageType
impl Clone for MessageType
Source§fn clone(&self) -> MessageType
fn clone(&self) -> MessageType
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 moreAuto Trait Implementations§
impl Freeze for MessageType
impl RefUnwindSafe for MessageType
impl Send for MessageType
impl Sync for MessageType
impl Unpin for MessageType
impl UnsafeUnpin for MessageType
impl UnwindSafe for MessageType
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