#[non_exhaustive]pub enum ProtocolLevelNotification {
CancelRequestNotification(CancelRequestNotification),
}unstable_protocol_v2 only.Expand description
General protocol-level notifications that all sides are expected to implement.
Notifications whose methods start with ‘$/’ are messages which
are protocol implementation dependent and might not be implementable in all
clients or agents. For example if the implementation uses a single threaded
synchronous programming language then there is little it can do to react to
a $/cancel_request notification. If an agent or client receives
notifications starting with ‘$/’ it is free to ignore the notification.
Notifications do not expect a response.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
CancelRequestNotification(CancelRequestNotification)
Cancels an ongoing request.
This is a notification sent by the side that sent a request to cancel that request.
Upon receiving this notification, the receiver:
- MAY cancel the corresponding request activity and all nested activities
- MAY send any pending notifications.
- MUST still send a response for the original request. If the request already finished
or is not cancelled, that is its normal response. If it is cancelled, it is either the
method’s defined cancellation result (for example an inserted
session/prompt, or acancelledpermission outcome) or an error with code-32800(Request Cancelled).
Receivers MUST ignore this notification for an unknown or already-answered request ID, and MUST NOT send a second response for it.
See protocol docs: Cancellation
Implementations§
Trait Implementations§
Source§impl Clone for ProtocolLevelNotification
impl Clone for ProtocolLevelNotification
Source§impl Debug for ProtocolLevelNotification
impl Debug for ProtocolLevelNotification
Source§impl<'de> Deserialize<'de> for ProtocolLevelNotification
impl<'de> Deserialize<'de> for ProtocolLevelNotification
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>,
Source§impl JsonSchema for ProtocolLevelNotification
Available on crate feature schemars only.
impl JsonSchema for ProtocolLevelNotification
schemars only.Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more