chore: add #[non_exhaustive] and mutation methods to improve compatibility (#715)

* chore: add #[non_exhaustive] to reduce backwards-incompatible changes going forward

* fix: remove ProtocolVersion import

* fix: add a few more with_ mutator methods

---------

Co-authored-by: Alex Hancock <alexhancock@block.xyz>
This commit is contained in:
Jack Amadeo 2026-03-03 10:38:01 -05:00 • committed by GitHub
commit f63718d202
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,8 +4,8 @@ mod common;
use std::sync::Arc;
use common::handlers::{TestClientHandler, TestServer};
use rmcp::{ClientHandler, ServerHandler};
use common::handlers::TestServer;
use rmcp::ServerHandler;
#[test]
fn test_wrapped_server_handlers() {
@ -16,8 +16,11 @@ fn test_wrapped_server_handlers() {
accepts_server_handler(Arc::new(TestServer::new()));
}
#[cfg(feature = "client")]
#[test]
fn test_wrapped_client_handlers() {
use common::handlers::TestClientHandler;
use rmcp::ClientHandler;
// This test asserts that, when T: ClientHandler, both Box<T> and Arc<T> also implement ClientHandler.
fn accepts_client_handler<H: ClientHandler>(_handler: H) {}