pub enum MessageKind {
Request,
Notification,
Result,
Error,
}Expand description
Which of the four JSON-RPC 2.0 shapes a message is.
Resolved by decode and stored, so no later stage re-derives it. A
request is a message with a method and an id; a notification is a
message with a method and no id; the two reply shapes have an id and
no method.
Variants§
Request
method and id: expects a reply.
Notification
method and no id: no reply is ever sent.
Result
id and result.
Error
id and error.
Implementations§
Source§impl MessageKind
impl MessageKind
Sourcepub const fn expects_reply(self) -> bool
pub const fn expects_reply(self) -> bool
Whether a reply is expected.
Trait Implementations§
Source§impl Clone for MessageKind
impl Clone for MessageKind
impl Copy for MessageKind
Source§impl Debug for MessageKind
impl Debug for MessageKind
impl Eq for MessageKind
Source§impl Hash for MessageKind
impl Hash for MessageKind
Source§impl PartialEq for MessageKind
impl PartialEq for MessageKind
impl StructuralPartialEq for MessageKind
Auto Trait Implementations§
impl Freeze for MessageKind
impl RefUnwindSafe for MessageKind
impl Send for MessageKind
impl Sync for MessageKind
impl Unpin for MessageKind
impl UnsafeUnpin for MessageKind
impl UnwindSafe for MessageKind
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