mirror of
https://git.proxmox.com/git/proxmox
synced 2025-07-27 02:27:42 +00:00
api types: BackupType: add iter for enum
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
c2049bce7f
commit
f64272b948
@ -439,6 +439,7 @@ pub enum BackupType {
|
||||
|
||||
/// "Host" backups.
|
||||
Host,
|
||||
// NOTE: if you add new types, don't forget to adapt the iter below!
|
||||
}
|
||||
|
||||
impl BackupType {
|
||||
@ -458,6 +459,10 @@ impl BackupType {
|
||||
BackupType::Vm => 2,
|
||||
}
|
||||
}
|
||||
|
||||
pub const fn iter() -> &'static [BackupType] {
|
||||
&[Self::Vm, Self::Ct, Self::Host]
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for BackupType {
|
||||
|
Loading…
Reference in New Issue
Block a user