pub struct JsonrpcNotification {
pub method: String,
pub params: Option<JsonrpcNotificationParams>,
/* private fields */
}
Expand description
A notification which does not expect a response.
JSON schema
{
"description": "A notification which does not expect a response.",
"type": "object",
"required": [
"jsonrpc",
"method"
],
"properties": {
"jsonrpc": {
"type": "string",
"const": "2.0"
},
"method": {
"type": "string"
},
"params": {
"type": "object",
"properties": {
"_meta": {
"description": "This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.",
"type": "object",
"additionalProperties": {}
}
},
"additionalProperties": {}
}
}
}
Fields§
§method: String
§params: Option<JsonrpcNotificationParams>
Implementations§
Source§impl JsonrpcNotification
impl JsonrpcNotification
pub fn new( method: String, params: Option<JsonrpcNotificationParams>, ) -> JsonrpcNotification
pub fn jsonrpc(&self) -> &String
Trait Implementations§
Source§impl Clone for JsonrpcNotification
impl Clone for JsonrpcNotification
Source§fn clone(&self) -> JsonrpcNotification
fn clone(&self) -> JsonrpcNotification
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 JsonrpcNotification
impl Debug for JsonrpcNotification
Source§impl<'de> Deserialize<'de> for JsonrpcNotification
impl<'de> Deserialize<'de> for JsonrpcNotification
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<JsonrpcNotification, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<JsonrpcNotification, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<JsonrpcNotification> for JsonrpcBatchRequestItem
impl From<JsonrpcNotification> for JsonrpcBatchRequestItem
Source§fn from(value: JsonrpcNotification) -> JsonrpcBatchRequestItem
fn from(value: JsonrpcNotification) -> JsonrpcBatchRequestItem
Converts to this type from the input type.
Source§impl From<JsonrpcNotification> for JsonrpcMessage
impl From<JsonrpcNotification> for JsonrpcMessage
Source§fn from(value: JsonrpcNotification) -> JsonrpcMessage
fn from(value: JsonrpcNotification) -> JsonrpcMessage
Converts to this type from the input type.
Source§impl Serialize for JsonrpcNotification
impl Serialize for JsonrpcNotification
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
Auto Trait Implementations§
impl Freeze for JsonrpcNotification
impl RefUnwindSafe for JsonrpcNotification
impl Send for JsonrpcNotification
impl Sync for JsonrpcNotification
impl Unpin for JsonrpcNotification
impl UnwindSafe for JsonrpcNotification
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