mirror of
https://git.proxmox.com/git/proxmox
synced 2025-05-02 06:20:01 +00:00
![]() In order to get parameters from the command line into the API we need to get them into a json value, so that we can pass it down the handler which deserializes them into their real type and runs verifications. For this we need to define how the type is going to be converted into a json Value. We cannot simply use Deserialize as that would for instance require quotes around strings. So instead, we have a ParseCli trait, which is a nop (direct serde_json::Value::String()) for string types, and uses .parse() (the std::str::FromStr trait) for everything else. Currently this uses a `default fn` as an example of the specialization feature, but I'll probably remove this and use yet another mass-impl macro since there isn't much activity on that feature's issue tracker. (The issue itself seems to be outdated ... Signed-off-by: Wolfgang Bumiller <wry.git@bumiller.com> |
||
---|---|---|
.. | ||
src | ||
tests | ||
Cargo.toml |