2021-07-07 11:47:17 +00:00
|
|
|
pub use pbs_api_types::upid::UPID;
|
2020-08-06 13:46:01 +00:00
|
|
|
|
2021-07-07 11:47:17 +00:00
|
|
|
pub trait UPIDExt: private::Sealed {
|
|
|
|
/// Returns the absolute path to the task log file
|
|
|
|
fn log_path(&self) -> std::path::PathBuf;
|
2019-04-08 16:43:26 +00:00
|
|
|
}
|
|
|
|
|
2021-07-07 11:47:17 +00:00
|
|
|
mod private {
|
|
|
|
pub trait Sealed {}
|
|
|
|
impl Sealed for super::UPID {}
|
2020-08-18 07:04:21 +00:00
|
|
|
}
|
|
|
|
|
2021-07-07 11:47:17 +00:00
|
|
|
impl UPIDExt for UPID {
|
|
|
|
fn log_path(&self) -> std::path::PathBuf {
|
2019-04-08 16:43:26 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|