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:
parent
ee1c63c53f
commit
6a3b32d3ab
1 changed files with 430 additions and 211 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue