Refactor datafile path handling

This commit is contained in:
Dominik Werder
2021-04-27 17:33:42 +02:00
parent 0b40702b6c
commit 18c11b30fd
10 changed files with 240 additions and 120 deletions

View File

@@ -152,11 +152,27 @@ pub enum TimeRange {
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Nanos {
pub ns: u64,
}
#[derive(Clone, Serialize, Deserialize)]
pub struct NanoRange {
pub beg: u64,
pub end: u64,
}
impl std::fmt::Debug for NanoRange {
fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(
fmt,
"NanoRange {{ beg: {} s, end: {} s }}",
self.beg / SEC,
self.end / SEC
)
}
}
impl NanoRange {
pub fn delta(&self) -> u64 {
self.end - self.beg