From: Stefan Hanreich <s.hanreich@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH proxmox v2 4/4] pve-api-types: sdn: handle fallback variant
Date: Thu, 13 Nov 2025 16:09:28 +0100 [thread overview]
Message-ID: <20251113150934.611263-5-s.hanreich@proxmox.com> (raw)
In-Reply-To: <20251113150934.611263-1-s.hanreich@proxmox.com>
Add the fallback variant to as_str. The only current callers of this
method don't require 'static lifetime, so it is safe to remove here.
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
pve-api-types/src/sdn.rs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pve-api-types/src/sdn.rs b/pve-api-types/src/sdn.rs
index 8188c35f..97972275 100644
--- a/pve-api-types/src/sdn.rs
+++ b/pve-api-types/src/sdn.rs
@@ -33,10 +33,11 @@ impl SdnController {
}
impl ClusterResourceNetworkType {
- pub fn as_str(&self) -> &'static str {
+ pub fn as_str(&self) -> &str {
match self {
ClusterResourceNetworkType::Fabric => "fabric",
ClusterResourceNetworkType::Zone => "zone",
+ ClusterResourceNetworkType::UnknownEnumValue(value) => value.as_str(),
}
}
}
--
2.47.3
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
next prev parent reply other threads:[~2025-11-13 15:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-13 15:09 [pdm-devel] [RFC proxmox{, -yew-comp, -datacenter-manager}/yew-mobile-gui v2 0/7] Add fallback variant to enum properties in Proxmox VE Rust API types Stefan Hanreich
2025-11-13 15:09 ` [pdm-devel] [PATCH proxmox v2 1/4] pve-api-types: add FixedString type Stefan Hanreich
2025-11-13 15:09 ` [pdm-devel] [PATCH proxmox v2 2/4] pve-api-types: generate fallback variant for enums Stefan Hanreich
2025-11-13 15:09 ` [pdm-devel] [PATCH proxmox v2 3/4] pve-api-types: regenerate Stefan Hanreich
2025-11-13 15:09 ` Stefan Hanreich [this message]
2025-11-13 15:09 ` [pdm-devel] [PATCH proxmox-yew-comp v2 1/1] pve: qemu: handle fallback enum variants Stefan Hanreich
2025-11-13 15:09 ` [pdm-devel] [PATCH proxmox-datacenter-manager v2 1/1] tree-wide: handle new unknown " Stefan Hanreich
2025-11-13 15:09 ` [pdm-devel] [PATCH pve-yew-mobile-gui v2 1/1] tree-wide: handle fallback enum values Stefan Hanreich
2025-11-13 20:33 ` [pdm-devel] [RFC proxmox{, -yew-comp, -datacenter-manager}/yew-mobile-gui v2 0/7] Add fallback variant to enum properties in Proxmox VE Rust API types Thomas Lamprecht
2025-11-13 21:28 ` [pdm-devel] applied-series: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251113150934.611263-5-s.hanreich@proxmox.com \
--to=s.hanreich@proxmox.com \
--cc=pdm-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox