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

Allow specifying aliases for e.g. enum variants. #180

Open
ModProg opened this issue Oct 5, 2024 · 0 comments
Open

Allow specifying aliases for e.g. enum variants. #180

ModProg opened this issue Oct 5, 2024 · 0 comments

Comments

@ModProg
Copy link

ModProg commented Oct 5, 2024

I can see two implementations, either add an additional alias field to the musli attribute that takes a list of names, or extend the name field:

For serializing this doesn't change anything, but for parsing this would mean it needs to accept the primary as well as all aliases. AFAICT, this would only make sense when using names and not indexes.

#[musli(name = "primary", alias = "secondary")]
#[musli(name("primary", "secondary")]
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

No branches or pull requests

1 participant