mirror of
https://git.proxmox.com/git/proxmox
synced 2026-01-28 09:06:57 +00:00
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>
|
||
|---|---|---|
| api-test | ||
| proxmox | ||
| proxmox-api | ||
| proxmox-api-macro | ||
| proxmox-sys | ||
| proxmox-tools | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| Makefile | ||
| rust-toolchain | ||
| rustfmt.toml | ||