Skip to content

Commit 379ed85

Browse files
authored
fix method access modifiers (#42)
1 parent 0b8f622 commit 379ed85

File tree

4 files changed

+34
-8
lines changed

4 files changed

+34
-8
lines changed

src/generated_schema/2024_11_05/mcp_schema.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
///
77
/// Generated from : <https://github.com/modelcontextprotocol/specification.git>
88
/// Hash : bb1446ff1810a0df57989d78366d626d2c01b9d7
9-
/// Generated at : 2025-02-28 18:09:15
9+
/// Generated at : 2025-03-02 12:29:03
1010
/// ----------------------------------------------------------------------------
1111
///
1212
/// MCP Protocol Version

src/generated_schema/2024_11_05/schema_utils.rs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ impl RequestFromClient {
386386
}
387387
}
388388

389-
fn method(&self) -> &str {
389+
pub fn method(&self) -> &str {
390390
match self {
391391
RequestFromClient::ClientRequest(request) => request.method(),
392392
RequestFromClient::CustomRequest(request) => request["method"].as_str().unwrap(),
@@ -914,7 +914,7 @@ impl RequestFromServer {
914914
}
915915
}
916916

917-
fn method(&self) -> &str {
917+
pub fn method(&self) -> &str {
918918
match self {
919919
RequestFromServer::ServerRequest(request) => request.method(),
920920
RequestFromServer::CustomRequest(request) => request["method"].as_str().unwrap(),
@@ -1028,7 +1028,7 @@ impl NotificationFromServer {
10281028
}
10291029
}
10301030

1031-
fn method(&self) -> &str {
1031+
pub fn method(&self) -> &str {
10321032
match self {
10331033
NotificationFromServer::ServerNotification(notification) => notification.method(),
10341034
NotificationFromServer::CustomNotification(notification) => notification["method"].as_str().unwrap(),
@@ -1368,6 +1368,10 @@ impl FromMessage<MessageFromClient> for ClientMessage {
13681368
}
13691369
}
13701370

1371+
//**************************//
1372+
//** UnknownTool Error **//
1373+
//**************************//
1374+
13711375
/// A custom error type `UnknownTool` that wraps a `String`.
13721376
/// This can be used as the error type in the result of a `CallToolRequest` when a non-existent or unimplemented tool is called.
13731377
#[derive(Debug)]
@@ -1384,6 +1388,9 @@ impl core::fmt::Display for UnknownTool {
13841388
// Implement the `Error` trait for `UnknownTool`, making it a valid error type.
13851389
impl std::error::Error for UnknownTool {}
13861390

1391+
//***************************//
1392+
//** CallToolError Error **//
1393+
//***************************//
13871394
/// A specific error type that can hold any kind of error and is used to
13881395
/// encapsulate various error scenarios when a `CallToolRequest` fails.
13891396
#[derive(Debug)]
@@ -1426,6 +1433,9 @@ impl From<CallToolError> for CallToolResult {
14261433
}
14271434
}
14281435

1436+
//***************************//
1437+
//** CallToolResult Impl **//
1438+
//***************************//
14291439
impl CallToolResult {
14301440
/// Create a `CallToolResult` with an error, containing an error message in the content
14311441
pub fn with_error(error: CallToolError) -> Self {
@@ -1473,6 +1483,9 @@ impl CallToolResult {
14731483
}
14741484
}
14751485

1486+
//**************************************//
1487+
//** CallToolResultContentItem Impl **//
1488+
//**************************************//
14761489
impl CallToolResultContentItem {
14771490
/// Create a `CallToolResultContentItem` with text content and optional annotations
14781491
pub fn text_content(test_content: String, annotations: Option<TextContentAnnotations>) -> Self {

src/generated_schema/draft/mcp_schema.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
///
77
/// Generated from : <https://github.com/modelcontextprotocol/specification.git>
88
/// Hash : bb1446ff1810a0df57989d78366d626d2c01b9d7
9-
/// Generated at : 2025-02-28 18:09:15
9+
/// Generated at : 2025-03-02 12:29:04
1010
/// ----------------------------------------------------------------------------
1111
///
1212
/// MCP Protocol Version

src/generated_schema/draft/schema_utils.rs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ impl RequestFromClient {
386386
}
387387
}
388388

389-
fn method(&self) -> &str {
389+
pub fn method(&self) -> &str {
390390
match self {
391391
RequestFromClient::ClientRequest(request) => request.method(),
392392
RequestFromClient::CustomRequest(request) => request["method"].as_str().unwrap(),
@@ -914,7 +914,7 @@ impl RequestFromServer {
914914
}
915915
}
916916

917-
fn method(&self) -> &str {
917+
pub fn method(&self) -> &str {
918918
match self {
919919
RequestFromServer::ServerRequest(request) => request.method(),
920920
RequestFromServer::CustomRequest(request) => request["method"].as_str().unwrap(),
@@ -1028,7 +1028,7 @@ impl NotificationFromServer {
10281028
}
10291029
}
10301030

1031-
fn method(&self) -> &str {
1031+
pub fn method(&self) -> &str {
10321032
match self {
10331033
NotificationFromServer::ServerNotification(notification) => notification.method(),
10341034
NotificationFromServer::CustomNotification(notification) => notification["method"].as_str().unwrap(),
@@ -1368,6 +1368,10 @@ impl FromMessage<MessageFromClient> for ClientMessage {
13681368
}
13691369
}
13701370

1371+
//**************************//
1372+
//** UnknownTool Error **//
1373+
//**************************//
1374+
13711375
/// A custom error type `UnknownTool` that wraps a `String`.
13721376
/// This can be used as the error type in the result of a `CallToolRequest` when a non-existent or unimplemented tool is called.
13731377
#[derive(Debug)]
@@ -1384,6 +1388,9 @@ impl core::fmt::Display for UnknownTool {
13841388
// Implement the `Error` trait for `UnknownTool`, making it a valid error type.
13851389
impl std::error::Error for UnknownTool {}
13861390

1391+
//***************************//
1392+
//** CallToolError Error **//
1393+
//***************************//
13871394
/// A specific error type that can hold any kind of error and is used to
13881395
/// encapsulate various error scenarios when a `CallToolRequest` fails.
13891396
#[derive(Debug)]
@@ -1426,6 +1433,9 @@ impl From<CallToolError> for CallToolResult {
14261433
}
14271434
}
14281435

1436+
//***************************//
1437+
//** CallToolResult Impl **//
1438+
//***************************//
14291439
impl CallToolResult {
14301440
/// Create a `CallToolResult` with an error, containing an error message in the content
14311441
pub fn with_error(error: CallToolError) -> Self {
@@ -1473,6 +1483,9 @@ impl CallToolResult {
14731483
}
14741484
}
14751485

1486+
//**************************************//
1487+
//** CallToolResultContentItem Impl **//
1488+
//**************************************//
14761489
impl CallToolResultContentItem {
14771490
/// Create a `CallToolResultContentItem` with text content and optional annotations
14781491
pub fn text_content(test_content: String, annotations: Option<TextContentAnnotations>) -> Self {

0 commit comments

Comments
 (0)