This commit is contained in:
Dominik Werder
2021-06-14 23:10:14 +02:00
parent bb6d853b78
commit bebce14f56
9 changed files with 881 additions and 67 deletions

View File

@@ -1,4 +1,4 @@
use crate::agg::enp::{WaveEvents, XBinnedScalarEvents};
use crate::agg::enp::{WaveEvents, XBinnedScalarEvents, XBinnedWaveEvents};
use crate::agg::eventbatch::MinMaxAvgScalarEventBatch;
use crate::agg::scalarbinbatch::MinMaxAvgScalarBinBatch;
use crate::agg::streams::StreamItem;
@@ -104,6 +104,13 @@ where
const FRAME_TYPE_ID: u32 = 0x800 + NTY::SUB;
}
impl<NTY> FrameType for Sitemty<XBinnedWaveEvents<NTY>>
where
NTY: SubFrId,
{
const FRAME_TYPE_ID: u32 = 0x800 + NTY::SUB;
}
pub trait ProvidesFrameType {
fn frame_type_id(&self) -> u32;
}
@@ -160,6 +167,15 @@ where
}
}
impl<NTY> Framable for Sitemty<XBinnedWaveEvents<NTY>>
where
NTY: NumOps + Serialize,
{
fn make_frame(&self) -> Result<BytesMut, Error> {
make_frame(self)
}
}
pub fn make_frame<FT>(item: &FT) -> Result<BytesMut, Error>
where
FT: FrameType + Serialize,