pub enum Message {
Request(Request),
Response(Response),
Notification(Notification),
}Variants§
Implementations§
Source§impl Message
impl Message
pub fn is_request(&self) -> bool
pub fn is_response(&self) -> bool
pub fn is_notification(&self) -> bool
pub fn as_request(&self) -> Option<&Request>
pub fn as_response(&self) -> Option<&Response>
pub fn as_notification(&self) -> Option<&Notification>
pub fn into_request(self) -> Option<Request>
pub fn into_response(self) -> Option<Response>
pub fn into_notification(self) -> Option<Notification>
pub fn method(&self) -> Option<&str>
pub fn id(&self) -> Option<&RequestId>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
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 Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
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