WIP before remove of function bodies

This commit is contained in:
Dominik Werder
2023-03-09 13:58:13 +01:00
parent 3993fc0432
commit f262f7e9df
4 changed files with 73 additions and 40 deletions

View File

@@ -770,6 +770,13 @@ pub enum SeriesRange {
}
impl SeriesRange {
pub fn dim0kind(&self) -> Dim0Kind {
match self {
SeriesRange::TimeRange(_) => Dim0Kind::Time,
SeriesRange::PulseRange(_) => Dim0Kind::Pulse,
}
}
pub fn is_time(&self) -> bool {
match self {
SeriesRange::TimeRange(_) => true,
@@ -1148,6 +1155,12 @@ pub mod timeunits {
pub const DAY: u64 = HOUR * 24;
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum Dim0Kind {
Time,
Pulse,
}
pub trait Dim0Index: Clone + fmt::Debug + PartialOrd {
fn add(&self, v: &Self) -> Self;
fn sub(&self, v: &Self) -> Self;
@@ -1678,6 +1691,13 @@ impl BinnedRangeEnum {
pub fn range_at(&self, i: usize) -> Option<SeriesRange> {
err::todoval()
}
pub fn dim0kind(&self) -> Dim0Kind {
match self {
BinnedRangeEnum::Time(_) => Dim0Kind::Time,
BinnedRangeEnum::Pulse(_) => Dim0Kind::Pulse,
}
}
}
#[cfg(test)]