api types: BackupType: add iter for enum
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
b6c8717cc2
commit
77337b3b4c
|
@ -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