BackupDir: add group/dir accessors

for getting the respective api type references for convenient
printing/logging.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2022-05-16 13:31:49 +02:00 committed by Thomas Lamprecht
parent 90915ab629
commit f15601f1c9

View File

@ -369,6 +369,14 @@ impl BackupDir {
&self.backup_time_string
}
pub fn dir(&self) -> &pbs_api_types::BackupDir {
&self.dir
}
pub fn group(&self) -> &pbs_api_types::BackupGroup {
&self.dir.group
}
pub fn relative_path(&self) -> PathBuf {
let mut path = self.ns.path();
path.push(self.dir.group.ty.as_str());