Skip to content
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

Add flattening, unindexed, unlabeled, dynamic, transparent support #156

Merged
merged 37 commits into from
Sep 17, 2023

Conversation

KodrAus
Copy link
Collaborator

@KodrAus KodrAus commented Sep 10, 2023

This PR is a big feature enhancement to the derive macros. It adds the following new attributes:

  • #[sval(unlabeled_values)] and #[sval(unindexed_values)]: streams a struct as a tuple if unlabeled, as a record if unindexed, and as a sequence if both unlabeled and unindexed.
  • #[sval(dynamic)]: makes enums untagged.
  • #[sval(transparent)]: makes a newtype stream as its single field.
  • #[sval(flatten)]: flattens enum variants, the key-values of maps, values of sequences, and fields of records and tuples onto their parent value.

I've done some major refactoring of the derive macros to support all this new stuff; it's basically rewritten. We still need to do proper error reporting, but are making incremental steps towards something more broadly useful.

@KodrAus KodrAus marked this pull request as ready for review September 17, 2023 09:11
@KodrAus KodrAus merged commit 9ce852a into main Sep 17, 2023
42 checks passed
@KodrAus KodrAus deleted the feat/flatten branch September 17, 2023 22:23
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.

1 participant