pub enum Message {
Request(Request),
Response(Response),
Notification(Notification),
}Expand description
Represents a JSON RPC message that could be either Request or Response or Notification
Variants§
Request(Request)
See Request
Response(Response)
See Response
Notification(Notification)
See Notification
Implementations§
Source§impl Message
impl Message
Sourcepub fn session_id(&self) -> Option<&Uuid>
pub fn session_id(&self) -> Option<&Uuid>
Returns MCP Session ID
Sourcepub fn set_session_id(self, id: Uuid) -> Self
pub fn set_session_id(self, id: Uuid) -> Self
Sets MCP Session ID
Sourcepub fn set_headers(self, headers: HeaderMap) -> Self
pub fn set_headers(self, headers: HeaderMap) -> Self
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
Source§impl From<Notification> for Message
impl From<Notification> for Message
Source§fn from(notification: Notification) -> Self
fn from(notification: Notification) -> Self
Converts to this type from the input type.
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