proxmox-backup/src/server/upid.rs
Wolfgang Bumiller 95f9d67ce9 move UPID to pbs-api-types, add UPIDExt
pbs-server side related methods are added via the UPIDExt
trait

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-07-07 13:51:03 +02:00

21 lines
520 B
Rust

pub use pbs_api_types::upid::UPID;
pub trait UPIDExt: private::Sealed {
/// Returns the absolute path to the task log file
fn log_path(&self) -> std::path::PathBuf;
}
mod private {
pub trait Sealed {}
impl Sealed for super::UPID {}
}
impl UPIDExt for UPID {
fn log_path(&self) -> std::path::PathBuf {
let mut path = std::path::PathBuf::from(super::PROXMOX_BACKUP_TASK_DIR);
path.push(format!("{:02X}", self.pstart % 256));
path.push(self.to_string());
path
}
}