proxmox/proxmox-api-macro
Wolfgang Bumiller 0046e5e33a macro: experimental support for enums with values
enum Foo {
    Variant1(Type),          // allowed
    Variant2(Type, Type),    // not allowed
    Variant3 { name: Type }, // not allowed
}

In the simple case of a single type we simply drop the
automatically derived `FromStr`/`Display` impls and expect
the user to implement them manually, while in the `verify()`
method we simply match on self and forward to the inner
verifier.

So to get "tagged unions" in the API, implement a proper
API type for each variant, then add an enum with 1-tuple
variants.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-08-12 12:00:12 +02:00
..
src macro: experimental support for enums with values 2019-08-12 12:00:12 +02:00
tests macro: derive ser/de for newtypes just like structs 2019-08-08 11:29:12 +02:00
Cargo.toml macro: remove exact futures-preview version 2019-08-12 10:42:19 +02:00