Go to file
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
api-test macro: derive ser/de for newtypes just like structs 2019-08-08 11:29:12 +02:00
proxmox cleanup Cargo.toml files 2019-08-05 14:09:54 +02:00
proxmox-api formatting fixup 2019-08-05 09:45:14 +02:00
proxmox-api-macro macro: experimental support for enums with values 2019-08-12 12:00:12 +02:00
proxmox-sys formatting fixup 2019-08-05 14:14:23 +02:00
proxmox-tools formatting fixup 2019-08-05 14:14:23 +02:00
.gitignore import Cargo.lock 2019-08-09 08:44:48 +02:00
Cargo.lock import Cargo.lock 2019-08-09 08:44:48 +02:00
Cargo.toml add an api-test module 2019-06-12 15:54:52 +02:00
Makefile add make apitest 2019-06-18 17:53:43 +02:00
rust-toolchain initial import, starting with vec & io helpers 2019-06-06 14:00:25 +02:00
rustfmt.toml initial import, starting with vec & io helpers 2019-06-06 14:00:25 +02:00