Skip to content

Add Support for Enum Struct Variants #21

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
mitsuhiko opened this issue Feb 11, 2022 · 0 comments
Open

Add Support for Enum Struct Variants #21

mitsuhiko opened this issue Feb 11, 2022 · 0 comments
Labels
design Design considerations

Comments

@mitsuhiko
Copy link
Owner

mitsuhiko commented Feb 11, 2022

Similar to serde it should be possible to serializer and deserialize enums with structs in them. There are two cases to cover:

Newtype pattern:

struct A {
  a: bool
}

struct B {
  b: bool
}

enum Foo {
  A(A),
  B(B),
}

Embedded struct variant pattern:

enum Foo {
  A { a: bool },
  B { b: bool },
}

Either of them should likely work the same. This issue relates to the question of buffering and state (#20).

@mitsuhiko mitsuhiko added the design Design considerations label Feb 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Design considerations
Projects
None yet
Development

No branches or pull requests

1 participant