Skip to content

Implement sval2 support #400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Techcable
Copy link
Contributor

@Techcable Techcable commented Jun 29, 2025

Supports serialization without recursion, allowing arbitrary nesting.

This library is used as part of the log and value-bag crates.

Supports serialization without nesting
@cuviper
Copy link
Member

cuviper commented Jul 1, 2025

Is there precedent in the sval ecosystem for calling the feature "sval2"? It looks like there was never really a v1, so I'm not sure the number is needed.

I don't understand the "without recursion" point -- the implementation you've written sure does look like it's recursing for the nested key and value types!

@Techcable
Copy link
Contributor Author

Techcable commented Jul 12, 2025

I don't understand the "without recursion" point -- the implementation you've written sure does look like it's recursing for the nested key and value types!

Sorry. I confused this with another library and updated the comment. I still think it could be useful by having simpler codegen, although it would be straightforward to polyfill using sval_serde. My use case is simple reflection similar to value-bag.

Is there precedent in the sval ecosystem for calling the feature "sval2"? It looks like there was never really a v1, so I'm not sure the number is needed.

I will change it.

@@ -0,0 +1,36 @@
#![cfg_attr(docsrs, doc(cfg(feature = "serde")))]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#![cfg_attr(docsrs, doc(cfg(feature = "serde")))]
#![cfg_attr(docsrs, doc(cfg(feature = "sval")))]

rustdoc-args = ["--cfg", "docsrs"]

[workspace]
members = ["test-nostd", "test-serde"]
members = ["test-nostd", "test-serde", "test-sval"]
Copy link
Member

Choose a reason for hiding this comment

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

This test needs to be added to .github/workflows/ci.yml as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants