diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs index e0b900d9..0500e85c 100644 --- a/pbs-api-types/src/datastore.rs +++ b/pbs-api-types/src/datastore.rs @@ -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 {