Move binned type, add tests

This commit is contained in:
Dominik Werder
2022-12-05 12:01:19 +01:00
parent 4a250227cd
commit aa74fd4f25
33 changed files with 1988 additions and 699 deletions

View File

@@ -1,6 +1,8 @@
pub mod binsdim0;
pub mod binsxbindim0;
pub mod channelevents;
pub mod eventsdim0;
pub mod eventsxbindim0;
pub mod merger;
pub mod merger_cev;
pub mod streams;
@@ -138,6 +140,12 @@ impl serde::de::Error for Error {
#[derive(Clone, Debug, PartialEq, Deserialize)]
pub struct IsoDateTime(DateTime<Utc>);
impl IsoDateTime {
pub fn from_u64(ts: u64) -> Self {
IsoDateTime(Utc.timestamp_nanos(ts as i64))
}
}
impl Serialize for IsoDateTime {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
@@ -182,6 +190,7 @@ impl crate::merger::Mergeable for Box<dyn Events> {
}
}
// TODO rename to `Typed`
pub trait TimeBinnableType: Send + Unpin + RangeOverlapInfo {
type Output: TimeBinnableType;
type Aggregator: TimeBinnableTypeAggregator<Input = Self, Output = Self::Output> + Send + Unpin;