rrd: derive Display and FromStr for api types
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
This commit is contained in:
parent
fda2cdb7ed
commit
9426af0abf
@ -20,6 +20,7 @@ nix.workspace = true
|
||||
serde.workspace = true
|
||||
serde_cbor.workspace = true
|
||||
serde_json.workspace = true
|
||||
serde_plain.workspace = true
|
||||
|
||||
proxmox-schema = { workspace = true, features = [ "api-macro" ] }
|
||||
proxmox-sys.workspace = true
|
||||
|
@ -13,6 +13,9 @@ pub enum RRDMode {
|
||||
Average,
|
||||
}
|
||||
|
||||
serde_plain::derive_display_from_serialize!(RRDMode);
|
||||
serde_plain::derive_fromstr_from_deserialize!(RRDMode);
|
||||
|
||||
#[api]
|
||||
#[derive(Copy, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
@ -31,3 +34,6 @@ pub enum RRDTimeFrame {
|
||||
/// Decade (10 years)
|
||||
Decade,
|
||||
}
|
||||
|
||||
serde_plain::derive_display_from_serialize!(RRDTimeFrame);
|
||||
serde_plain::derive_fromstr_from_deserialize!(RRDTimeFrame);
|
||||
|
Loading…
Reference in New Issue
Block a user