pub enum NotificationFromServer {
ServerNotification(ServerNotification),
CustomNotification(Value),
}
Expand description
To determine standard and custom notifications received from the MCP Server Custom notifications are of type serde_json::Value and can be deserialized into any custom type.
Variants§
ServerNotification(ServerNotification)
CustomNotification(Value)
Implementations§
Trait Implementations§
Source§impl Clone for NotificationFromServer
impl Clone for NotificationFromServer
Source§fn clone(&self) -> NotificationFromServer
fn clone(&self) -> NotificationFromServer
Returns a copy 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 moreSource§impl Debug for NotificationFromServer
impl Debug for NotificationFromServer
Source§impl<'de> Deserialize<'de> for NotificationFromServer
impl<'de> Deserialize<'de> for NotificationFromServer
Source§fn deserialize<D>(
deserializer: D,
) -> Result<NotificationFromServer, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<NotificationFromServer, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<CancelledNotification> for NotificationFromServer
impl From<CancelledNotification> for NotificationFromServer
Source§fn from(value: CancelledNotification) -> NotificationFromServer
fn from(value: CancelledNotification) -> NotificationFromServer
Converts to this type from the input type.
Source§impl From<LoggingMessageNotification> for NotificationFromServer
impl From<LoggingMessageNotification> for NotificationFromServer
Source§fn from(value: LoggingMessageNotification) -> NotificationFromServer
fn from(value: LoggingMessageNotification) -> NotificationFromServer
Converts to this type from the input type.
Source§impl From<NotificationFromServer> for MessageFromServer
impl From<NotificationFromServer> for MessageFromServer
Source§fn from(value: NotificationFromServer) -> MessageFromServer
fn from(value: NotificationFromServer) -> MessageFromServer
Converts to this type from the input type.
Source§impl From<ProgressNotification> for NotificationFromServer
impl From<ProgressNotification> for NotificationFromServer
Source§fn from(value: ProgressNotification) -> NotificationFromServer
fn from(value: ProgressNotification) -> NotificationFromServer
Converts to this type from the input type.
Source§impl From<PromptListChangedNotification> for NotificationFromServer
impl From<PromptListChangedNotification> for NotificationFromServer
Source§fn from(value: PromptListChangedNotification) -> NotificationFromServer
fn from(value: PromptListChangedNotification) -> NotificationFromServer
Converts to this type from the input type.
Source§impl From<ResourceListChangedNotification> for NotificationFromServer
impl From<ResourceListChangedNotification> for NotificationFromServer
Source§fn from(value: ResourceListChangedNotification) -> NotificationFromServer
fn from(value: ResourceListChangedNotification) -> NotificationFromServer
Converts to this type from the input type.
Source§impl From<ResourceUpdatedNotification> for NotificationFromServer
impl From<ResourceUpdatedNotification> for NotificationFromServer
Source§fn from(value: ResourceUpdatedNotification) -> NotificationFromServer
fn from(value: ResourceUpdatedNotification) -> NotificationFromServer
Converts to this type from the input type.
Source§impl From<ToolListChangedNotification> for NotificationFromServer
impl From<ToolListChangedNotification> for NotificationFromServer
Source§fn from(value: ToolListChangedNotification) -> NotificationFromServer
fn from(value: ToolListChangedNotification) -> NotificationFromServer
Converts to this type from the input type.
Source§impl Serialize for NotificationFromServer
impl Serialize for NotificationFromServer
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl TryFrom<NotificationFromServer> for CancelledNotification
impl TryFrom<NotificationFromServer> for CancelledNotification
Source§fn try_from(
value: NotificationFromServer,
) -> Result<CancelledNotification, <CancelledNotification as TryFrom<NotificationFromServer>>::Error>
fn try_from( value: NotificationFromServer, ) -> Result<CancelledNotification, <CancelledNotification as TryFrom<NotificationFromServer>>::Error>
Performs the conversion.
Source§impl TryFrom<NotificationFromServer> for LoggingMessageNotification
impl TryFrom<NotificationFromServer> for LoggingMessageNotification
Source§fn try_from(
value: NotificationFromServer,
) -> Result<LoggingMessageNotification, <LoggingMessageNotification as TryFrom<NotificationFromServer>>::Error>
fn try_from( value: NotificationFromServer, ) -> Result<LoggingMessageNotification, <LoggingMessageNotification as TryFrom<NotificationFromServer>>::Error>
Performs the conversion.
Source§impl TryFrom<NotificationFromServer> for ProgressNotification
impl TryFrom<NotificationFromServer> for ProgressNotification
Source§fn try_from(
value: NotificationFromServer,
) -> Result<ProgressNotification, <ProgressNotification as TryFrom<NotificationFromServer>>::Error>
fn try_from( value: NotificationFromServer, ) -> Result<ProgressNotification, <ProgressNotification as TryFrom<NotificationFromServer>>::Error>
Performs the conversion.
Source§impl TryFrom<NotificationFromServer> for PromptListChangedNotification
impl TryFrom<NotificationFromServer> for PromptListChangedNotification
Source§fn try_from(
value: NotificationFromServer,
) -> Result<PromptListChangedNotification, <PromptListChangedNotification as TryFrom<NotificationFromServer>>::Error>
fn try_from( value: NotificationFromServer, ) -> Result<PromptListChangedNotification, <PromptListChangedNotification as TryFrom<NotificationFromServer>>::Error>
Performs the conversion.
Source§impl TryFrom<NotificationFromServer> for ResourceListChangedNotification
impl TryFrom<NotificationFromServer> for ResourceListChangedNotification
Source§fn try_from(
value: NotificationFromServer,
) -> Result<ResourceListChangedNotification, <ResourceListChangedNotification as TryFrom<NotificationFromServer>>::Error>
fn try_from( value: NotificationFromServer, ) -> Result<ResourceListChangedNotification, <ResourceListChangedNotification as TryFrom<NotificationFromServer>>::Error>
Performs the conversion.
Source§impl TryFrom<NotificationFromServer> for ResourceUpdatedNotification
impl TryFrom<NotificationFromServer> for ResourceUpdatedNotification
Source§fn try_from(
value: NotificationFromServer,
) -> Result<ResourceUpdatedNotification, <ResourceUpdatedNotification as TryFrom<NotificationFromServer>>::Error>
fn try_from( value: NotificationFromServer, ) -> Result<ResourceUpdatedNotification, <ResourceUpdatedNotification as TryFrom<NotificationFromServer>>::Error>
Performs the conversion.
Source§impl TryFrom<NotificationFromServer> for ServerNotification
impl TryFrom<NotificationFromServer> for ServerNotification
Source§fn try_from(
value: NotificationFromServer,
) -> Result<ServerNotification, <ServerNotification as TryFrom<NotificationFromServer>>::Error>
fn try_from( value: NotificationFromServer, ) -> Result<ServerNotification, <ServerNotification as TryFrom<NotificationFromServer>>::Error>
Performs the conversion.
Source§impl TryFrom<NotificationFromServer> for ToolListChangedNotification
impl TryFrom<NotificationFromServer> for ToolListChangedNotification
Source§fn try_from(
value: NotificationFromServer,
) -> Result<ToolListChangedNotification, <ToolListChangedNotification as TryFrom<NotificationFromServer>>::Error>
fn try_from( value: NotificationFromServer, ) -> Result<ToolListChangedNotification, <ToolListChangedNotification as TryFrom<NotificationFromServer>>::Error>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for NotificationFromServer
impl RefUnwindSafe for NotificationFromServer
impl Send for NotificationFromServer
impl Sync for NotificationFromServer
impl Unpin for NotificationFromServer
impl UnwindSafe for NotificationFromServer
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