pub struct ClientNotification {
pub params: CancelledNotificationParams,
/* private fields */
}Expand description
Latest MCP Protocol 2026_07_28 This notification is sent by the client to indicate that it is cancelling a request it previously issued. On stdio, the server also sends this notification, solely to terminate a {@link SubscriptionsListenRequestsubscriptions/listen} stream: it references the ID of the subscriptions/listen request that opened the stream. Servers MUST NOT use this notification to cancel any other request. The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished. This notification indicates that the result will be unused, so any associated processing SHOULD cease.
JSON schema
{
"description": "This notification is sent by the client to indicate that it is cancelling a request it previously issued.\n\nOn stdio, the server also sends this notification, solely to terminate a {@link SubscriptionsListenRequestsubscriptions/listen} stream: it references the ID of the subscriptions/listen request that opened the stream. Servers MUST NOT use this notification to cancel any other request.\n\nThe request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.\n\nThis notification indicates that the result will be unused, so any associated processing SHOULD cease.",
"type": "object",
"required": [
"jsonrpc",
"method",
"params"
],
"properties": {
"jsonrpc": {
"type": "string",
"const": "2.0"
},
"method": {
"type": "string",
"const": "notifications/cancelled"
},
"params": {
"$ref": "#/$defs/CancelledNotificationParams"
}
}
}Fields§
§params: CancelledNotificationParamsImplementations§
Source§impl ClientNotification
impl ClientNotification
pub fn new(params: CancelledNotificationParams) -> Self
pub fn jsonrpc(&self) -> &String
pub fn method(&self) -> &String
Sourcepub fn method_value() -> &'static str
pub fn method_value() -> &'static str
returns “notifications/cancelled”
pub fn method_name() -> &'static str
Use method_value() instead.
Trait Implementations§
Source§impl Clone for ClientNotification
impl Clone for ClientNotification
Source§fn clone(&self) -> ClientNotification
fn clone(&self) -> ClientNotification
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more