pub struct CancelledNotification {
pub params: CancelledNotificationParams,
/* private fields */
}
Expand description
This notification can be sent by either side to indicate that it is cancelling a previously-issued 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. A client MUST NOT attempt to cancel its initialize request.
JSON schema
{
"description": "This notification can be sent by either side to indicate that it is cancelling a previously-issued 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.\n\nA client MUST NOT attempt to cancel its initialize request.",
"type": "object",
"required": [
"method",
"params"
],
"properties": {
"method": {
"type": "string",
"const": "notifications/cancelled"
},
"params": {
"type": "object",
"required": [
"requestId"
],
"properties": {
"reason": {
"description": "An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.",
"type": "string"
},
"requestId": {
"description": "The ID of the request to cancel.\n\nThis MUST correspond to the ID of a request previously issued in the same direction.",
"$ref": "#/definitions/RequestId"
}
}
}
}
}
Fields§
§params: CancelledNotificationParams
Implementations§
Source§impl CancelledNotification
impl CancelledNotification
pub fn new(params: CancelledNotificationParams) -> CancelledNotification
pub fn method(&self) -> &String
pub fn method_name() -> String
Trait Implementations§
Source§impl Clone for CancelledNotification
impl Clone for CancelledNotification
Source§fn clone(&self) -> CancelledNotification
fn clone(&self) -> CancelledNotification
Returns a duplicate 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 CancelledNotification
impl Debug for CancelledNotification
Source§impl<'de> Deserialize<'de> for CancelledNotification
impl<'de> Deserialize<'de> for CancelledNotification
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CancelledNotification, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CancelledNotification, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<CancelledNotification> for ClientJsonrpcNotification
impl From<CancelledNotification> for ClientJsonrpcNotification
Source§fn from(value: CancelledNotification) -> ClientJsonrpcNotification
fn from(value: CancelledNotification) -> ClientJsonrpcNotification
Converts to this type from the input type.
Source§impl From<CancelledNotification> for ClientNotification
impl From<CancelledNotification> for ClientNotification
Source§fn from(value: CancelledNotification) -> ClientNotification
fn from(value: CancelledNotification) -> ClientNotification
Converts to this type from the input type.
Source§impl From<CancelledNotification> for MessageFromClient
impl From<CancelledNotification> for MessageFromClient
Source§fn from(value: CancelledNotification) -> MessageFromClient
fn from(value: CancelledNotification) -> MessageFromClient
Converts to this type from the input type.
Source§impl From<CancelledNotification> for MessageFromServer
impl From<CancelledNotification> for MessageFromServer
Source§fn from(value: CancelledNotification) -> MessageFromServer
fn from(value: CancelledNotification) -> MessageFromServer
Converts to this type from the input type.
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<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<CancelledNotification> for ServerJsonrpcNotification
impl From<CancelledNotification> for ServerJsonrpcNotification
Source§fn from(value: CancelledNotification) -> ServerJsonrpcNotification
fn from(value: CancelledNotification) -> ServerJsonrpcNotification
Converts to this type from the input type.
Source§impl From<CancelledNotification> for ServerNotification
impl From<CancelledNotification> for ServerNotification
Source§fn from(value: CancelledNotification) -> ServerNotification
fn from(value: CancelledNotification) -> ServerNotification
Converts to this type from the input type.
Source§impl FromMessage<CancelledNotification> for ClientMessage
impl FromMessage<CancelledNotification> for ClientMessage
fn from_message( message: CancelledNotification, request_id: Option<RequestId>, ) -> Result<ClientMessage, RpcError>
Source§impl FromMessage<CancelledNotification> for ServerMessage
impl FromMessage<CancelledNotification> for ServerMessage
fn from_message( message: CancelledNotification, request_id: Option<RequestId>, ) -> Result<ServerMessage, RpcError>
Source§impl Serialize for CancelledNotification
impl Serialize for CancelledNotification
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 ToMessage<ClientMessage> for CancelledNotification
impl ToMessage<ClientMessage> for CancelledNotification
fn to_message( self, request_id: Option<RequestId>, ) -> Result<ClientMessage, RpcError>
Source§impl ToMessage<ServerMessage> for CancelledNotification
impl ToMessage<ServerMessage> for CancelledNotification
fn to_message( self, request_id: Option<RequestId>, ) -> Result<ServerMessage, RpcError>
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<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.
Auto Trait Implementations§
impl Freeze for CancelledNotification
impl RefUnwindSafe for CancelledNotification
impl Send for CancelledNotification
impl Sync for CancelledNotification
impl Unpin for CancelledNotification
impl UnwindSafe for CancelledNotification
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