|
1 | 1 | use crate::generated_schema::mcp_2024_11_05::*;
|
| 2 | + |
2 | 3 | use serde::ser::SerializeStruct;
|
3 | 4 | use serde_json::{json, Value};
|
4 | 5 | use std::hash::{Hash, Hasher};
|
@@ -318,7 +319,7 @@ impl Display for ClientJsonrpcRequest {
|
318 | 319 | write!(
|
319 | 320 | f,
|
320 | 321 | "{}",
|
321 |
| - serde_json::to_string(self).unwrap_or_else(|err| format!("Serialization error: {}", err)) |
| 322 | + serde_json::to_string(self).unwrap_or_else(|err| format!("Serialization error: {err}")) |
322 | 323 | )
|
323 | 324 | }
|
324 | 325 | }
|
@@ -446,7 +447,7 @@ impl Display for ClientJsonrpcNotification {
|
446 | 447 | write!(
|
447 | 448 | f,
|
448 | 449 | "{}",
|
449 |
| - serde_json::to_string(self).unwrap_or_else(|err| format!("Serialization error: {}", err)) |
| 450 | + serde_json::to_string(self).unwrap_or_else(|err| format!("Serialization error: {err}")) |
450 | 451 | )
|
451 | 452 | }
|
452 | 453 | }
|
@@ -548,7 +549,7 @@ impl Display for ClientJsonrpcResponse {
|
548 | 549 | write!(
|
549 | 550 | f,
|
550 | 551 | "{}",
|
551 |
| - serde_json::to_string(self).unwrap_or_else(|err| format!("Serialization error: {}", err)) |
| 552 | + serde_json::to_string(self).unwrap_or_else(|err| format!("Serialization error: {err}")) |
552 | 553 | )
|
553 | 554 | }
|
554 | 555 | }
|
@@ -632,7 +633,7 @@ impl Display for ClientMessage {
|
632 | 633 | write!(
|
633 | 634 | f,
|
634 | 635 | "{}",
|
635 |
| - serde_json::to_string(self).unwrap_or_else(|err| format!("Serialization error: {}", err)) |
| 636 | + serde_json::to_string(self).unwrap_or_else(|err| format!("Serialization error: {err}")) |
636 | 637 | )
|
637 | 638 | }
|
638 | 639 | }
|
@@ -814,7 +815,7 @@ impl Display for ServerMessage {
|
814 | 815 | write!(
|
815 | 816 | f,
|
816 | 817 | "{}",
|
817 |
| - serde_json::to_string(self).unwrap_or_else(|err| format!("Serialization error: {}", err)) |
| 818 | + serde_json::to_string(self).unwrap_or_else(|err| format!("Serialization error: {err}")) |
818 | 819 | )
|
819 | 820 | }
|
820 | 821 | }
|
@@ -853,7 +854,7 @@ impl Display for ServerJsonrpcRequest {
|
853 | 854 | write!(
|
854 | 855 | f,
|
855 | 856 | "{}",
|
856 |
| - serde_json::to_string(self).unwrap_or_else(|err| format!("Serialization error: {}", err)) |
| 857 | + serde_json::to_string(self).unwrap_or_else(|err| format!("Serialization error: {err}")) |
857 | 858 | )
|
858 | 859 | }
|
859 | 860 | }
|
@@ -959,7 +960,7 @@ impl Display for ServerJsonrpcNotification {
|
959 | 960 | write!(
|
960 | 961 | f,
|
961 | 962 | "{}",
|
962 |
| - serde_json::to_string(self).unwrap_or_else(|err| format!("Serialization error: {}", err)) |
| 963 | + serde_json::to_string(self).unwrap_or_else(|err| format!("Serialization error: {err}")) |
963 | 964 | )
|
964 | 965 | }
|
965 | 966 | }
|
@@ -1052,7 +1053,7 @@ impl Display for ServerJsonrpcResponse {
|
1052 | 1053 | write!(
|
1053 | 1054 | f,
|
1054 | 1055 | "{}",
|
1055 |
| - serde_json::to_string(self).unwrap_or_else(|err| format!("Serialization error: {}", err)) |
| 1056 | + serde_json::to_string(self).unwrap_or_else(|err| format!("Serialization error: {err}")) |
1056 | 1057 | )
|
1057 | 1058 | }
|
1058 | 1059 | }
|
@@ -1129,7 +1130,7 @@ impl Display for JsonrpcError {
|
1129 | 1130 | write!(
|
1130 | 1131 | f,
|
1131 | 1132 | "{}",
|
1132 |
| - serde_json::to_string(self).unwrap_or_else(|err| format!("Serialization error: {}", err)) |
| 1133 | + serde_json::to_string(self).unwrap_or_else(|err| format!("Serialization error: {err}")) |
1133 | 1134 | )
|
1134 | 1135 | }
|
1135 | 1136 | }
|
@@ -2346,7 +2347,7 @@ impl Display for RpcError {
|
2346 | 2347 | write!(
|
2347 | 2348 | f,
|
2348 | 2349 | "{}",
|
2349 |
| - serde_json::to_string(self).unwrap_or_else(|err| format!("Serialization error: {}", err)) |
| 2350 | + serde_json::to_string(self).unwrap_or_else(|err| format!("Serialization error: {err}")) |
2350 | 2351 | )
|
2351 | 2352 | }
|
2352 | 2353 | }
|
@@ -3639,7 +3640,7 @@ impl CallToolResultContentItem {
|
3639 | 3640 | ) -> Self {
|
3640 | 3641 | EmbeddedResource::new(resource, annotations).into()
|
3641 | 3642 | }
|
3642 |
| - /// Returns the content type as a string based on the variant of `CallToolResultContentItem`. |
| 3643 | + ///Returns the content type as a string based on the variant of `CallToolResultContentItem` |
3643 | 3644 | pub fn content_type(&self) -> &str {
|
3644 | 3645 | match self {
|
3645 | 3646 | CallToolResultContentItem::TextContent(text_content) => text_content.type_(),
|
@@ -3721,7 +3722,7 @@ impl CallToolResult {
|
3721 | 3722 | meta: None,
|
3722 | 3723 | }
|
3723 | 3724 | }
|
3724 |
| - /// Adds metadata to the `CallToolResult`, allowing additional context or information to be included |
| 3725 | + /// Assigns metadata to the CallToolResult, enabling the inclusion of extra context or details. |
3725 | 3726 | pub fn with_meta(mut self, meta: Option<serde_json::Map<String, Value>>) -> Self {
|
3726 | 3727 | self.meta = meta;
|
3727 | 3728 | self
|
|
0 commit comments