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

@ -6,12 +6,7 @@ fn serialize_tool_result_with_meta() {
let content = vec![Content::text("ok")];
let mut meta = Meta::new();
meta.insert("foo".to_string(), json!("bar"));
let result = CallToolResult {
content,
structured_content: None,
is_error: Some(false),
meta: Some(meta),
};
let result = CallToolResult::success(content).with_meta(Some(meta));
let v = serde_json::to_value(&result).unwrap();
let expected = json!({
"content": [{"type":"text","text":"ok"}],