pub enum NotificationFromClient {
ClientNotification(ClientNotification),
CustomNotification(Value),
}
Expand description
To determine standard and custom notifications received from the MCP Client Custom notifications are of type serde_json::Value and can be deserialized into any custom type.
Variants§
ClientNotification(ClientNotification)
CustomNotification(Value)
Implementations§
Source§impl NotificationFromClient
impl NotificationFromClient
Sourcepub fn is_initialized_notification(&self) -> bool
pub fn is_initialized_notification(&self) -> bool
Checks if the current notification is an InitializedNotification
from the client, indicating that the client has been initialized.
Trait Implementations§
Source§impl Clone for NotificationFromClient
impl Clone for NotificationFromClient
Source§fn clone(&self) -> NotificationFromClient
fn clone(&self) -> NotificationFromClient
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 NotificationFromClient
impl Debug for NotificationFromClient
Source§impl<'de> Deserialize<'de> for NotificationFromClient
impl<'de> Deserialize<'de> for NotificationFromClient
Source§fn deserialize<D>(
deserializer: D,
) -> Result<NotificationFromClient, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<NotificationFromClient, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<CancelledNotification> for NotificationFromClient
impl From<CancelledNotification> for NotificationFromClient
Source§fn from(value: CancelledNotification) -> NotificationFromClient
fn from(value: CancelledNotification) -> NotificationFromClient
Converts to this type from the input type.
Source§impl From<InitializedNotification> for NotificationFromClient
impl From<InitializedNotification> for NotificationFromClient
Source§fn from(value: InitializedNotification) -> NotificationFromClient
fn from(value: InitializedNotification) -> NotificationFromClient
Converts to this type from the input type.
Source§impl From<NotificationFromClient> for MessageFromClient
impl From<NotificationFromClient> for MessageFromClient
Source§fn from(value: NotificationFromClient) -> MessageFromClient
fn from(value: NotificationFromClient) -> MessageFromClient
Converts to this type from the input type.
Source§impl From<ProgressNotification> for NotificationFromClient
impl From<ProgressNotification> for NotificationFromClient
Source§fn from(value: ProgressNotification) -> NotificationFromClient
fn from(value: ProgressNotification) -> NotificationFromClient
Converts to this type from the input type.
Source§impl From<RootsListChangedNotification> for NotificationFromClient
impl From<RootsListChangedNotification> for NotificationFromClient
Source§fn from(value: RootsListChangedNotification) -> NotificationFromClient
fn from(value: RootsListChangedNotification) -> NotificationFromClient
Converts to this type from the input type.
Source§impl Serialize for NotificationFromClient
impl Serialize for NotificationFromClient
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<NotificationFromClient> for CancelledNotification
impl TryFrom<NotificationFromClient> for CancelledNotification
Source§fn try_from(
value: NotificationFromClient,
) -> Result<CancelledNotification, <CancelledNotification as TryFrom<NotificationFromClient>>::Error>
fn try_from( value: NotificationFromClient, ) -> Result<CancelledNotification, <CancelledNotification as TryFrom<NotificationFromClient>>::Error>
Performs the conversion.
Source§impl TryFrom<NotificationFromClient> for ClientNotification
impl TryFrom<NotificationFromClient> for ClientNotification
Source§fn try_from(
value: NotificationFromClient,
) -> Result<ClientNotification, <ClientNotification as TryFrom<NotificationFromClient>>::Error>
fn try_from( value: NotificationFromClient, ) -> Result<ClientNotification, <ClientNotification as TryFrom<NotificationFromClient>>::Error>
Performs the conversion.
Source§impl TryFrom<NotificationFromClient> for InitializedNotification
impl TryFrom<NotificationFromClient> for InitializedNotification
Source§fn try_from(
value: NotificationFromClient,
) -> Result<InitializedNotification, <InitializedNotification as TryFrom<NotificationFromClient>>::Error>
fn try_from( value: NotificationFromClient, ) -> Result<InitializedNotification, <InitializedNotification as TryFrom<NotificationFromClient>>::Error>
Performs the conversion.
Source§impl TryFrom<NotificationFromClient> for ProgressNotification
impl TryFrom<NotificationFromClient> for ProgressNotification
Source§fn try_from(
value: NotificationFromClient,
) -> Result<ProgressNotification, <ProgressNotification as TryFrom<NotificationFromClient>>::Error>
fn try_from( value: NotificationFromClient, ) -> Result<ProgressNotification, <ProgressNotification as TryFrom<NotificationFromClient>>::Error>
Performs the conversion.
Source§impl TryFrom<NotificationFromClient> for RootsListChangedNotification
impl TryFrom<NotificationFromClient> for RootsListChangedNotification
Source§fn try_from(
value: NotificationFromClient,
) -> Result<RootsListChangedNotification, <RootsListChangedNotification as TryFrom<NotificationFromClient>>::Error>
fn try_from( value: NotificationFromClient, ) -> Result<RootsListChangedNotification, <RootsListChangedNotification as TryFrom<NotificationFromClient>>::Error>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for NotificationFromClient
impl RefUnwindSafe for NotificationFromClient
impl Send for NotificationFromClient
impl Sync for NotificationFromClient
impl Unpin for NotificationFromClient
impl UnwindSafe for NotificationFromClient
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