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

derive(State) for enums #27

Open
mappum opened this issue Apr 29, 2020 · 2 comments
Open

derive(State) for enums #27

mappum opened this issue Apr 29, 2020 · 2 comments

Comments

@mappum
Copy link
Contributor

mappum commented Apr 29, 2020

We can support enums as State types by storing a byte to mark the variant at the root key, and using that to instantiate the enum variant (each variant's fields must implement State).

The only questions are how to map variant fields to keys (we want to share data between variant transitions without copying) and how to transition between variants (maybe the author can create transitions with impl From<VariantContentsA> for VariantContentsB, although we will have to somehow delete the data for dropped fields).

@mappum
Copy link
Contributor Author

mappum commented Feb 19, 2021

This depends on figuring out a good state composability pattern, as is the goal in #26.

@mappum mappum mentioned this issue Jun 7, 2021
5 tasks
@mappum mappum changed the title #[state] macro for enums derive(State) for enums Sep 4, 2021
@mappum
Copy link
Contributor Author

mappum commented Sep 7, 2021

This also applies to derive(Query).

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