use std::time::{Duration, SystemTime};
#[derive(Clone, Debug)]
pub struct BuildStamp {
pub git_revision: &'static str,
pub git_revision_cleanness: &'static str,
pub git_clean: bool,
pub git_status: &'static str,
pub build_time_seconds: u64,
pub build_time_nanos: u64,
}
impl BuildStamp {
pub const fn git_revision(&self) -> &'static str {
self.git_revision
}
pub const fn git_clean(&self) -> bool {
self.git_clean
}
pub const fn git_revision_cleanness(&self) -> &'static str {
self.git_revision_cleanness
}
pub const fn git_status(&self) -> &'static str {
self.git_status
}
pub fn build_time(&self) -> SystemTime {
SystemTime::UNIX_EPOCH
+ Duration::from_secs(self.build_time_seconds)
+ Duration::from_nanos(self.build_time_nanos)
}
}