Skip to content

Comments

Add helpers to build enum from concrete values#393

Merged
4t145 merged 1 commit intomodelcontextprotocol:mainfrom
howardjohn:helpers/into-enum
Aug 29, 2025
Merged

Add helpers to build enum from concrete values#393
4t145 merged 1 commit intomodelcontextprotocol:mainfrom
howardjohn:helpers/into-enum

Conversation

@howardjohn
Copy link
Contributor

Motivation and Context

This allows building functions like

fn stream(resp: impl Into<ServerResult>, req_id: RequestId) -> Result<Response, UpstreamError> {
	let rpc = ServerJsonRpcMessage::response(resp.into(), req_id);

How Has This Been Tested?

Manually tested

Breaking Changes

No

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@github-actions github-actions bot added the T-core Core library changes label Aug 27, 2025
This allows building functions like

```rust
fn stream(resp: impl Into<ServerResult>, req_id: RequestId) -> Result<Response, UpstreamError> {
	let rpc = ServerJsonRpcMessage::response(resp.into(), req_id);
```
Copy link
Contributor

@4t145 4t145 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@4t145 4t145 merged commit 663d5a7 into modelcontextprotocol:main Aug 29, 2025
11 checks passed
@github-actions github-actions bot mentioned this pull request Aug 29, 2025
takumi-earth pushed a commit to earthlings-dev/rmcp that referenced this pull request Jan 27, 2026
…textprotocol#393)

This allows building functions like

```rust
fn stream(resp: impl Into<ServerResult>, req_id: RequestId) -> Result<Response, UpstreamError> {
	let rpc = ServerJsonRpcMessage::response(resp.into(), req_id);
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-core Core library changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants