chore: add #[non_exhaustive] to remaining public structs (#768)

* chore: add #[non_exhaustive] to remaining public structs

* chore: add #[non_exhaustive] to remaining public types

* chore: enable exhaustive_structs/enums clippy lints

* test: add untagged ServerResult deserialization regression tests
This commit is contained in:
Dale Seo 2026-03-26 10:23:58 -04:00 • committed by GitHub
commit 6a3b32d3ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,7 +8,6 @@ use rmcp::{
model::*,
service::{RequestContext, Service},
};
use tokio_util::sync::CancellationToken;
#[tokio::test]
async fn test_basic_sampling_message_creation() -> Result<()> {
@ -126,13 +125,7 @@ async fn test_sampling_integration_with_test_handlers() -> Result<()> {
let result = handler
.handle_request(
request.clone(),
RequestContext {
peer: client.peer().clone(),
ct: CancellationToken::new(),
id: NumberOrString::Number(1),
meta: Default::default(),
extensions: Default::default(),
},
RequestContext::new(NumberOrString::Number(1), client.peer().clone()),
)
.await?;
@ -189,13 +182,7 @@ async fn test_sampling_no_context_inclusion() -> Result<()> {
let result = handler
.handle_request(
request.clone(),
RequestContext {
peer: client.peer().clone(),
ct: CancellationToken::new(),
id: NumberOrString::Number(2),
meta: Default::default(),
extensions: Default::default(),
},
RequestContext::new(NumberOrString::Number(2), client.peer().clone()),
)
.await?;
@ -253,13 +240,7 @@ async fn test_sampling_error_invalid_message_sequence() -> Result<()> {
let result = handler
.handle_request(
request.clone(),
RequestContext {
peer: client.peer().clone(),
ct: CancellationToken::new(),
id: NumberOrString::Number(3),
meta: Default::default(),
extensions: Default::default(),
},
RequestContext::new(NumberOrString::Number(3), client.peer().clone()),
)
.await;