]> git.proxmox.com Git - proxmox-backup.git/commit
datastore: factor type out of ListGroups into ListGroupsType
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 13 Jul 2022 12:56:36 +0000 (14:56 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 14 Jul 2022 09:17:15 +0000 (11:17 +0200)
commit5444b914af6393914d52e3abab86057939ff4faf
treeea02e8325cdf00a57f6a01bffda84f6838cb2143
parent8f38e53896ace83c617d0a0f489499013acefd0f
datastore: factor type out of ListGroups into ListGroupsType

In the API we want to iterate over all backup groups
belonging to a particular type at least once, and iterating
through *everything* and simply "skipping" over every single
entry from another type makes no sense given that the groups
are organized into subdirectories based on their type.

Let's have an `.iter_backup_type()` method which returns an
iterator over all the groups of a specific type named
ListGroupsType and factorize the type level iterator out of
ListGroups for reuse.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
pbs-datastore/src/datastore.rs
pbs-datastore/src/hierarchy.rs
pbs-datastore/src/lib.rs