pub enum JsonRpcMessage {
Request(JsonRpcRequest),
Notification(JsonRpcNotification),
}
Expand description
Enum representing different types of JSON-RPC messages
Variants§
Request(JsonRpcRequest)
Notification(JsonRpcNotification)
Implementations§
Source§impl JsonRpcMessage
Utility functions for working with JSON-RPC messages
impl JsonRpcMessage
Utility functions for working with JSON-RPC messages
Sourcepub fn is_request(&self) -> bool
pub fn is_request(&self) -> bool
Check if this is a request (has ID)
Sourcepub fn is_notification(&self) -> bool
pub fn is_notification(&self) -> bool
Check if this is a notification (no ID)
Sourcepub fn request_id(&self) -> Option<&RequestId>
pub fn request_id(&self) -> Option<&RequestId>
Get the request ID if this is a request
Trait Implementations§
Source§impl Clone for JsonRpcMessage
impl Clone for JsonRpcMessage
Source§fn clone(&self) -> JsonRpcMessage
fn clone(&self) -> JsonRpcMessage
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 JsonRpcMessage
impl RefUnwindSafe for JsonRpcMessage
impl Send for JsonRpcMessage
impl Sync for JsonRpcMessage
impl Unpin for JsonRpcMessage
impl UnwindSafe for JsonRpcMessage
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