diff --git a/archapp/Cargo.toml b/archapp/Cargo.toml index 570bc89..8237dc1 100644 --- a/archapp/Cargo.toml +++ b/archapp/Cargo.toml @@ -2,7 +2,7 @@ name = "archapp" version = "0.0.1-a.dev.4" authors = ["Dominik Werder "] -edition = "2018" +edition = "2021" [dependencies] tokio = { version = "1.7.1", features = ["io-util", "net", "time", "sync", "fs", "parking_lot"] } diff --git a/archapp/src/archeng/datablock.rs b/archapp/src/archeng/datablock.rs index b1aa6bc..ee87473 100644 --- a/archapp/src/archeng/datablock.rs +++ b/archapp/src/archeng/datablock.rs @@ -4,8 +4,8 @@ use commonio::ringbuf::RingBuf; use commonio::{read_exact, seek}; use err::Error; use items::eventsitem::EventsItem; -use items::eventvalues::EventValues; use items::plainevents::{PlainEvents, ScalarPlainEvents, WavePlainEvents}; +use items::scalarevents::ScalarEvents; use items::waveevents::WaveEvents; use netpod::log::*; use netpod::timeunits::SEC; @@ -353,7 +353,7 @@ ex_v!(f64, ex_v_f64); macro_rules! read_msg { ($sty:ident, $exfs:ident, $exfv:ident, $evvar:ident, $rb:expr, $msglen:expr, $numsamples:expr, $dbrt:expr, $dbrcount:ident) => { if $dbrcount == 1 { - let mut evs = EventValues::empty(); + let mut evs = ScalarEvents::empty(); for _ in 0..$numsamples { $rb.fill_min($msglen).await?; let buf = $rb.data(); @@ -459,7 +459,7 @@ pub async fn read_data2( DbrType::DbrTimeString => { if dbrcount == 1 { // TODO - let evs = ScalarPlainEvents::I8(EventValues::empty()); + let evs = ScalarPlainEvents::I8(ScalarEvents::empty()); let plain = PlainEvents::Scalar(evs); let item = EventsItem::Plain(plain); item @@ -494,7 +494,7 @@ pub async fn read_data_1( DbrType::DbrTimeDouble => { if datafile_header.dbr_count == 1 { trace!("~~~~~~~~~~~~~~~~~~~~~ read scalar DbrTimeDouble"); - let mut evs = EventValues { + let mut evs = ScalarEvents { tss: vec![], values: vec![], }; diff --git a/archapp/src/events.rs b/archapp/src/events.rs index 7eed341..9c552e8 100644 --- a/archapp/src/events.rs +++ b/archapp/src/events.rs @@ -9,8 +9,8 @@ use futures_core::Stream; use futures_util::StreamExt; use items::binnedevents::{MultiBinWaveEvents, SingleBinWaveEvents, XBinnedEvents}; use items::eventsitem::EventsItem; -use items::eventvalues::EventValues; use items::plainevents::{PlainEvents, ScalarPlainEvents, WavePlainEvents}; +use items::scalarevents::ScalarEvents; use items::waveevents::WaveEvents; use items::xbinnedscalarevents::XBinnedScalarEvents; use items::xbinnedwaveevents::XBinnedWaveEvents; @@ -190,7 +190,7 @@ macro_rules! arm1 { } AggKind::Plain => arm2!( $item, - EventValues, + ScalarEvents, Plain, PlainEvents, Scalar, @@ -200,7 +200,7 @@ macro_rules! arm1 { ), AggKind::TimeWeightedScalar => arm2!( $item, - EventValues, + ScalarEvents, XBinnedEvents, XBinnedEvents, Scalar, @@ -210,7 +210,7 @@ macro_rules! arm1 { ), AggKind::DimXBins1 => arm2!( $item, - EventValues, + ScalarEvents, XBinnedEvents, XBinnedEvents, Scalar, @@ -220,7 +220,7 @@ macro_rules! arm1 { ), AggKind::DimXBinsN(_) => arm2!( $item, - EventValues, + ScalarEvents, XBinnedEvents, XBinnedEvents, Scalar, @@ -643,7 +643,7 @@ fn events_item_to_framable(ei: EventsItem) -> Result, E b.push(k); (a, b) }); - let b = EventValues { tss: x, values: y }; + let b = ScalarEvents { tss: x, values: y }; let b = Ok(StreamItem::DataItem(RangeCompletableItem::Data(b))); let ret = Box::new(b); Ok(ret) diff --git a/archapp/src/parse.rs b/archapp/src/parse.rs index bdccc3e..b5a08e7 100644 --- a/archapp/src/parse.rs +++ b/archapp/src/parse.rs @@ -8,8 +8,8 @@ use async_channel::{bounded, Receiver}; use chrono::{TimeZone, Utc}; use err::{ErrStr, Error}; use items::eventsitem::EventsItem; -use items::eventvalues::EventValues; use items::plainevents::{PlainEvents, ScalarPlainEvents, WavePlainEvents}; +use items::scalarevents::ScalarEvents; use items::waveevents::WaveEvents; use netpod::log::*; use netpod::{ArchiverAppliance, ChannelConfigQuery, ChannelConfigResponse}; @@ -41,7 +41,7 @@ pub struct PbFileReader { fn parse_scalar_byte(m: &[u8], year: u32) -> Result { let msg = crate::generated::EPICSEvent::ScalarByte::parse_from_bytes(m) .map_err(|_| Error::with_msg(format!("can not parse pb-type {}", "ScalarByte")))?; - let mut t = EventValues:: { + let mut t = ScalarEvents:: { tss: vec![], values: vec![], }; @@ -57,7 +57,7 @@ macro_rules! scalar_parse { ($m:expr, $year:expr, $pbt:ident, $eit:ident, $evty:ident) => {{ let msg = crate::generated::EPICSEvent::$pbt::parse_from_bytes($m) .map_err(|e| Error::with_msg(format!("can not parse pb-type {} {:?}", stringify!($pbt), e)))?; - let mut t = EventValues::<$evty> { + let mut t = ScalarEvents::<$evty> { tss: vec![], values: vec![], }; diff --git a/daqbufp2/src/test/events.rs b/daqbufp2/src/test/events.rs index d60589a..80f7d1b 100644 --- a/daqbufp2/src/test/events.rs +++ b/daqbufp2/src/test/events.rs @@ -8,7 +8,7 @@ use err::Error; use futures_util::{StreamExt, TryStreamExt}; use http::StatusCode; use hyper::Body; -use items::eventvalues::EventValues; +use items::scalarevents::ScalarEvents; use items::numops::NumOps; use items::{FrameType, RangeCompletableItem, Sitemty, StatsItem, StreamItem, WithLen}; use netpod::log::*; @@ -147,11 +147,11 @@ where None } StreamItem::DataItem(frame) => { - if frame.tyid() != > as FrameType>::FRAME_TYPE_ID { + if frame.tyid() != > as FrameType>::FRAME_TYPE_ID { error!("test receives unexpected tyid {:x}", frame.tyid()); None } else { - match bincode::deserialize::>>(frame.buf()) { + match bincode::deserialize::>>(frame.buf()) { Ok(item) => match item { Ok(item) => match item { StreamItem::Log(item) => { diff --git a/disk/src/agg/enp.rs b/disk/src/agg/enp.rs index d481f0f..df63906 100644 --- a/disk/src/agg/enp.rs +++ b/disk/src/agg/enp.rs @@ -1,5 +1,5 @@ -use items::eventvalues::EventValues; use items::numops::NumOps; +use items::scalarevents::ScalarEvents; use items::EventsNodeProcessor; use netpod::{AggKind, Shape}; use std::marker::PhantomData; @@ -12,8 +12,8 @@ impl EventsNodeProcessor for Identity where NTY: NumOps, { - type Input = EventValues; - type Output = EventValues; + type Input = ScalarEvents; + type Output = ScalarEvents; fn create(_shape: Shape, _agg_kind: AggKind) -> Self { Self { _m1: PhantomData } diff --git a/disk/src/binned.rs b/disk/src/binned.rs index 330f62b..2479bd7 100644 --- a/disk/src/binned.rs +++ b/disk/src/binned.rs @@ -21,8 +21,8 @@ use items::{ Clearable, EventsNodeProcessor, FilterFittingInside, Framable, FrameType, PushableIndex, RangeCompletableItem, Sitemty, StreamItem, TimeBinnableType, WithLen, }; -use netpod::log::*; use netpod::query::{BinnedQuery, RawEventsQuery}; +use netpod::{log::*, ScalarType}; use netpod::{ x_bin_count, BinnedRange, NodeConfigCached, PerfOpts, PreBinnedPatchIterator, PreBinnedPatchRange, Shape, }; @@ -54,6 +54,7 @@ impl ChannelExecFunction for BinnedBinaryChannelExec { fn exec( self, _byte_order: END, + _scalar_type: ScalarType, shape: Shape, event_value_shape: EVS, _events_node_proc: ENP, @@ -297,6 +298,7 @@ impl ChannelExecFunction for BinnedJsonChannelExec { fn exec( self, _byte_order: END, + _scalar_type: ScalarType, shape: Shape, event_value_shape: EVS, _events_node_proc: ENP, diff --git a/disk/src/channelexec.rs b/disk/src/channelexec.rs index ec489ba..85dcdd9 100644 --- a/disk/src/channelexec.rs +++ b/disk/src/channelexec.rs @@ -9,7 +9,7 @@ use err::Error; use futures_core::Stream; use futures_util::future::FutureExt; use futures_util::StreamExt; -use items::eventvalues::EventValues; +use items::scalarevents::ScalarEvents; use items::numops::{BoolNum, NumOps}; use items::streams::{Collectable, Collector}; use items::{ @@ -34,6 +34,7 @@ pub trait ChannelExecFunction { fn exec( self, byte_order: END, + scalar_type: ScalarType, shape: Shape, event_value_shape: EVS, events_node_proc: ENP, @@ -59,6 +60,7 @@ pub trait ChannelExecFunction { fn channel_exec_nty_end_evs_enp( f: F, byte_order: END, + scalar_type: ScalarType, shape: Shape, event_value_shape: EVS, events_node_proc: ENP, @@ -79,15 +81,21 @@ where Sitemty<<::Output as TimeBinnableType>::Output>: FrameType + Framable + DeserializeOwned, { - Ok(f.exec(byte_order, shape, event_value_shape, events_node_proc)?) + Ok(f.exec(byte_order, scalar_type, shape, event_value_shape, events_node_proc)?) } -fn channel_exec_nty_end(f: F, byte_order: END, shape: Shape, agg_kind: AggKind) -> Result +fn channel_exec_nty_end( + f: F, + byte_order: END, + scalar_type: ScalarType, + shape: Shape, + agg_kind: AggKind, +) -> Result where F: ChannelExecFunction, NTY: NumOps + NumFromBytes + 'static, END: Endianness + 'static, - EventValues: Collectable, + ScalarEvents: Collectable, { match shape { Shape::Scalar => { @@ -97,22 +105,22 @@ where AggKind::Plain => { let evs = EventValuesDim0Case::new(); let events_node_proc = < as EventValueShape>::NumXAggPlain as EventsNodeProcessor>::create(shape.clone(), agg_kind.clone()); - channel_exec_nty_end_evs_enp(f, byte_order, shape, evs, events_node_proc) + channel_exec_nty_end_evs_enp(f, byte_order, scalar_type, shape, evs, events_node_proc) } AggKind::TimeWeightedScalar => { let evs = EventValuesDim0Case::new(); let events_node_proc = < as EventValueShape>::NumXAggToSingleBin as EventsNodeProcessor>::create(shape.clone(), agg_kind.clone()); - channel_exec_nty_end_evs_enp(f, byte_order, shape, evs, events_node_proc) + channel_exec_nty_end_evs_enp(f, byte_order, scalar_type, shape, evs, events_node_proc) } AggKind::DimXBins1 => { let evs = EventValuesDim0Case::new(); let events_node_proc = < as EventValueShape>::NumXAggToSingleBin as EventsNodeProcessor>::create(shape.clone(), agg_kind.clone()); - channel_exec_nty_end_evs_enp(f, byte_order, shape, evs, events_node_proc) + channel_exec_nty_end_evs_enp(f, byte_order, scalar_type, shape, evs, events_node_proc) } AggKind::DimXBinsN(_) => { let evs = EventValuesDim0Case::new(); let events_node_proc = < as EventValueShape>::NumXAggToNBins as EventsNodeProcessor>::create(shape.clone(), agg_kind.clone()); - channel_exec_nty_end_evs_enp(f, byte_order, shape, evs, events_node_proc) + channel_exec_nty_end_evs_enp(f, byte_order, scalar_type, shape, evs, events_node_proc) } } } @@ -123,22 +131,22 @@ where AggKind::Plain => { let evs = EventValuesDim1Case::new(n); let events_node_proc = < as EventValueShape>::NumXAggPlain as EventsNodeProcessor>::create(shape.clone(), agg_kind.clone()); - channel_exec_nty_end_evs_enp(f, byte_order, shape, evs, events_node_proc) + channel_exec_nty_end_evs_enp(f, byte_order, scalar_type, shape, evs, events_node_proc) } AggKind::TimeWeightedScalar => { let evs = EventValuesDim1Case::new(n); let events_node_proc = < as EventValueShape>::NumXAggToSingleBin as EventsNodeProcessor>::create(shape.clone(), agg_kind.clone()); - channel_exec_nty_end_evs_enp(f, byte_order, shape, evs, events_node_proc) + channel_exec_nty_end_evs_enp(f, byte_order, scalar_type, shape, evs, events_node_proc) } AggKind::DimXBins1 => { let evs = EventValuesDim1Case::new(n); let events_node_proc = < as EventValueShape>::NumXAggToSingleBin as EventsNodeProcessor>::create(shape.clone(), agg_kind.clone()); - channel_exec_nty_end_evs_enp(f, byte_order, shape, evs, events_node_proc) + channel_exec_nty_end_evs_enp(f, byte_order, scalar_type, shape, evs, events_node_proc) } AggKind::DimXBinsN(_) => { let evs = EventValuesDim1Case::new(n); let events_node_proc = < as EventValueShape>::NumXAggToNBins as EventsNodeProcessor>::create(shape.clone(), agg_kind.clone()); - channel_exec_nty_end_evs_enp(f, byte_order, shape, evs, events_node_proc) + channel_exec_nty_end_evs_enp(f, byte_order, scalar_type, shape, evs, events_node_proc) } } } @@ -150,10 +158,10 @@ where } macro_rules! match_end { - ($f:expr, $nty:ident, $end:expr, $shape:expr, $agg_kind:expr, $node_config:expr) => { + ($f:expr, $nty:ident, $end:expr, $scalar_type:expr, $shape:expr, $agg_kind:expr, $node_config:expr) => { match $end { - ByteOrder::LE => channel_exec_nty_end::<_, $nty, _>($f, LittleEndian {}, $shape, $agg_kind), - ByteOrder::BE => channel_exec_nty_end::<_, $nty, _>($f, BigEndian {}, $shape, $agg_kind), + ByteOrder::LE => channel_exec_nty_end::<_, $nty, _>($f, LittleEndian {}, $scalar_type, $shape, $agg_kind), + ByteOrder::BE => channel_exec_nty_end::<_, $nty, _>($f, BigEndian {}, $scalar_type, $shape, $agg_kind), } }; } @@ -170,17 +178,17 @@ where F: ChannelExecFunction, { match scalar_type { - ScalarType::U8 => match_end!(f, u8, byte_order, shape, agg_kind, node_config), - ScalarType::U16 => match_end!(f, u16, byte_order, shape, agg_kind, node_config), - ScalarType::U32 => match_end!(f, u32, byte_order, shape, agg_kind, node_config), - ScalarType::U64 => match_end!(f, u64, byte_order, shape, agg_kind, node_config), - ScalarType::I8 => match_end!(f, i8, byte_order, shape, agg_kind, node_config), - ScalarType::I16 => match_end!(f, i16, byte_order, shape, agg_kind, node_config), - ScalarType::I32 => match_end!(f, i32, byte_order, shape, agg_kind, node_config), - ScalarType::I64 => match_end!(f, i64, byte_order, shape, agg_kind, node_config), - ScalarType::F32 => match_end!(f, f32, byte_order, shape, agg_kind, node_config), - ScalarType::F64 => match_end!(f, f64, byte_order, shape, agg_kind, node_config), - ScalarType::BOOL => match_end!(f, BoolNum, byte_order, shape, agg_kind, node_config), + ScalarType::U8 => match_end!(f, u8, byte_order, scalar_type, shape, agg_kind, node_config), + ScalarType::U16 => match_end!(f, u16, byte_order, scalar_type, shape, agg_kind, node_config), + ScalarType::U32 => match_end!(f, u32, byte_order, scalar_type, shape, agg_kind, node_config), + ScalarType::U64 => match_end!(f, u64, byte_order, scalar_type, shape, agg_kind, node_config), + ScalarType::I8 => match_end!(f, i8, byte_order, scalar_type, shape, agg_kind, node_config), + ScalarType::I16 => match_end!(f, i16, byte_order, scalar_type, shape, agg_kind, node_config), + ScalarType::I32 => match_end!(f, i32, byte_order, scalar_type, shape, agg_kind, node_config), + ScalarType::I64 => match_end!(f, i64, byte_order, scalar_type, shape, agg_kind, node_config), + ScalarType::F32 => match_end!(f, f32, byte_order, scalar_type, shape, agg_kind, node_config), + ScalarType::F64 => match_end!(f, f64, byte_order, scalar_type, shape, agg_kind, node_config), + ScalarType::BOOL => match_end!(f, BoolNum, byte_order, scalar_type, shape, agg_kind, node_config), } } @@ -246,6 +254,7 @@ impl ChannelExecFunction for PlainEvents { fn exec( self, byte_order: END, + _scalar_type: ScalarType, _shape: Shape, event_value_shape: EVS, _events_node_proc: ENP, @@ -407,6 +416,7 @@ impl ChannelExecFunction for PlainEventsJson { fn exec( self, byte_order: END, + _scalar_type: ScalarType, _shape: Shape, event_value_shape: EVS, _events_node_proc: ENP, @@ -456,6 +466,7 @@ impl ChannelExecFunction for PlainEventsJson { } } +// TODO remove when done. pub fn dummy_impl() { let channel: Channel = err::todoval(); let range: NanoRange = err::todoval(); diff --git a/disk/src/decode.rs b/disk/src/decode.rs index 597a436..3528e5c 100644 --- a/disk/src/decode.rs +++ b/disk/src/decode.rs @@ -5,7 +5,7 @@ use err::Error; use futures_core::Stream; use futures_util::StreamExt; use items::eventsitem::EventsItem; -use items::eventvalues::EventValues; +use items::scalarevents::ScalarEvents; use items::numops::{BoolNum, NumOps}; use items::plainevents::{PlainEvents, ScalarPlainEvents}; use items::waveevents::{WaveEvents, WaveNBinner, WavePlainProc, WaveXBinner}; @@ -100,7 +100,7 @@ where NTY: NumOps + NumFromBytes, { type Output = NTY; - type Batch = EventValues; + type Batch = ScalarEvents; fn convert(&self, buf: &[u8], big_endian: bool) -> Result { Ok(NTY::convert(buf, big_endian)) @@ -351,52 +351,52 @@ impl EventsItemStream { Shape::Scalar => match &tyi.as_ref().unwrap().0 { ScalarType::U8 => { // TODO - let cont = EventValues::::empty(); + let cont = ScalarEvents::::empty(); ret = Some(EventsItem::Plain(PlainEvents::Scalar(ScalarPlainEvents::I8(cont)))); } ScalarType::U16 => { // TODO - let cont = EventValues::::empty(); + let cont = ScalarEvents::::empty(); ret = Some(EventsItem::Plain(PlainEvents::Scalar(ScalarPlainEvents::I16(cont)))); } ScalarType::U32 => { // TODO - let cont = EventValues::::empty(); + let cont = ScalarEvents::::empty(); ret = Some(EventsItem::Plain(PlainEvents::Scalar(ScalarPlainEvents::I32(cont)))); } ScalarType::U64 => { // TODO - let cont = EventValues::::empty(); + let cont = ScalarEvents::::empty(); ret = Some(EventsItem::Plain(PlainEvents::Scalar(ScalarPlainEvents::I32(cont)))); } ScalarType::I8 => { - let cont = EventValues::::empty(); + let cont = ScalarEvents::::empty(); ret = Some(EventsItem::Plain(PlainEvents::Scalar(ScalarPlainEvents::I8(cont)))); } ScalarType::I16 => { - let cont = EventValues::::empty(); + let cont = ScalarEvents::::empty(); ret = Some(EventsItem::Plain(PlainEvents::Scalar(ScalarPlainEvents::I16(cont)))); } ScalarType::I32 => { - let cont = EventValues::::empty(); + let cont = ScalarEvents::::empty(); ret = Some(EventsItem::Plain(PlainEvents::Scalar(ScalarPlainEvents::I32(cont)))); } ScalarType::I64 => { // TODO - let cont = EventValues::::empty(); + let cont = ScalarEvents::::empty(); ret = Some(EventsItem::Plain(PlainEvents::Scalar(ScalarPlainEvents::I32(cont)))); } ScalarType::F32 => { - let cont = EventValues::::empty(); + let cont = ScalarEvents::::empty(); ret = Some(EventsItem::Plain(PlainEvents::Scalar(ScalarPlainEvents::F32(cont)))); } ScalarType::F64 => { - let cont = EventValues::::empty(); + let cont = ScalarEvents::::empty(); ret = Some(EventsItem::Plain(PlainEvents::Scalar(ScalarPlainEvents::F64(cont)))); } ScalarType::BOOL => { // TODO - let cont = EventValues::::empty(); + let cont = ScalarEvents::::empty(); ret = Some(EventsItem::Plain(PlainEvents::Scalar(ScalarPlainEvents::I8(cont)))); } }, diff --git a/items/Cargo.toml b/items/Cargo.toml index 1c9225b..2003176 100644 --- a/items/Cargo.toml +++ b/items/Cargo.toml @@ -2,7 +2,7 @@ name = "items" version = "0.0.1-a.dev.4" authors = ["Dominik Werder "] -edition = "2018" +edition = "2021" [dependencies] serde = { version = "1.0", features = ["derive"] } diff --git a/items/src/lib.rs b/items/src/lib.rs index f5c1269..4848736 100644 --- a/items/src/lib.rs +++ b/items/src/lib.rs @@ -1,6 +1,5 @@ pub mod binnedevents; pub mod eventsitem; -pub mod eventvalues; pub mod frame; pub mod inmem; pub mod minmaxavgbins; @@ -8,6 +7,7 @@ pub mod minmaxavgdim1bins; pub mod minmaxavgwavebins; pub mod numops; pub mod plainevents; +pub mod scalarevents; pub mod streams; pub mod waveevents; pub mod xbinnedscalarevents; diff --git a/items/src/plainevents.rs b/items/src/plainevents.rs index cfe8b68..b0a5dd4 100644 --- a/items/src/plainevents.rs +++ b/items/src/plainevents.rs @@ -1,6 +1,6 @@ use crate::binnedevents::{SingleBinWaveEvents, XBinnedEvents}; use crate::eventsitem::EventsItem; -use crate::eventvalues::EventValues; +use crate::scalarevents::ScalarEvents; use crate::waveevents::{WaveEvents, WaveXBinner}; use crate::xbinnedscalarevents::XBinnedScalarEvents; use crate::{Appendable, Clearable, EventsNodeProcessor, PushableIndex, WithLen, WithTimestamps}; @@ -12,16 +12,16 @@ use serde::{Deserialize, Serialize}; #[derive(Debug, Serialize, Deserialize)] pub enum ScalarPlainEvents { - U8(EventValues), - U16(EventValues), - U32(EventValues), - U64(EventValues), - I8(EventValues), - I16(EventValues), - I32(EventValues), - I64(EventValues), - F32(EventValues), - F64(EventValues), + U8(ScalarEvents), + U16(ScalarEvents), + U32(ScalarEvents), + U64(ScalarEvents), + I8(ScalarEvents), + I16(ScalarEvents), + I32(ScalarEvents), + I64(ScalarEvents), + F32(ScalarEvents), + F64(ScalarEvents), } impl ScalarPlainEvents { diff --git a/items/src/eventvalues.rs b/items/src/scalarevents.rs similarity index 93% rename from items/src/eventvalues.rs rename to items/src/scalarevents.rs index e2cbcd2..b547669 100644 --- a/items/src/eventvalues.rs +++ b/items/src/scalarevents.rs @@ -16,19 +16,19 @@ use tokio::fs::File; // TODO add pulse. Is this even used?? // TODO change name, it's not only about values, but more like batch of whole events. #[derive(Serialize, Deserialize)] -pub struct EventValues { +pub struct ScalarEvents { pub tss: Vec, pub values: Vec, } -impl SitemtyFrameType for EventValues +impl SitemtyFrameType for ScalarEvents where NTY: NumOps, { const FRAME_TYPE_ID: u32 = crate::EVENT_VALUES_FRAME_TYPE_ID + NTY::SUB; } -impl EventValues { +impl ScalarEvents { pub fn empty() -> Self { Self { tss: vec![], @@ -37,7 +37,7 @@ impl EventValues { } } -impl fmt::Debug for EventValues +impl fmt::Debug for ScalarEvents where NTY: fmt::Debug, { @@ -54,7 +54,7 @@ where } } -impl WithLen for EventValues +impl WithLen for ScalarEvents where NTY: NumOps, { @@ -63,7 +63,7 @@ where } } -impl WithTimestamps for EventValues +impl WithTimestamps for ScalarEvents where NTY: NumOps, { @@ -72,7 +72,7 @@ where } } -impl ByteEstimate for EventValues +impl ByteEstimate for ScalarEvents where NTY: NumOps, { @@ -86,7 +86,7 @@ where } } -impl RangeOverlapInfo for EventValues { +impl RangeOverlapInfo for ScalarEvents { fn ends_before(&self, range: NanoRange) -> bool { match self.tss.last() { Some(&ts) => ts < range.beg, @@ -109,7 +109,7 @@ impl RangeOverlapInfo for EventValues { } } -impl FitsInside for EventValues { +impl FitsInside for ScalarEvents { fn fits_inside(&self, range: NanoRange) -> Fits { if self.tss.is_empty() { Fits::Empty @@ -133,7 +133,7 @@ impl FitsInside for EventValues { } } -impl FilterFittingInside for EventValues { +impl FilterFittingInside for ScalarEvents { fn filter_fitting_inside(self, fit_range: NanoRange) -> Option { match self.fits_inside(fit_range) { Fits::Inside | Fits::PartlyGreater | Fits::PartlyLower | Fits::PartlyLowerAndGreater => Some(self), @@ -142,7 +142,7 @@ impl FilterFittingInside for EventValues { } } -impl PushableIndex for EventValues +impl PushableIndex for ScalarEvents where NTY: NumOps, { @@ -152,7 +152,7 @@ where } } -impl Appendable for EventValues +impl Appendable for ScalarEvents where NTY: NumOps, { @@ -166,14 +166,14 @@ where } } -impl Clearable for EventValues { +impl Clearable for ScalarEvents { fn clear(&mut self) { self.tss.clear(); self.values.clear(); } } -impl ReadableFromFile for EventValues +impl ReadableFromFile for ScalarEvents where NTY: NumOps, { @@ -187,7 +187,7 @@ where } } -impl TimeBinnableType for EventValues +impl TimeBinnableType for ScalarEvents where NTY: NumOps, { @@ -204,7 +204,7 @@ where } pub struct EventValuesCollector { - vals: EventValues, + vals: ScalarEvents, range_complete: bool, timed_out: bool, } @@ -212,7 +212,7 @@ pub struct EventValuesCollector { impl EventValuesCollector { pub fn new() -> Self { Self { - vals: EventValues::empty(), + vals: ScalarEvents::empty(), range_complete: false, timed_out: false, } @@ -244,7 +244,7 @@ impl Collector for EventValuesCollector where NTY: NumOps, { - type Input = EventValues; + type Input = ScalarEvents; type Output = EventValuesCollectorOutput; fn ingest(&mut self, src: &Self::Input) { @@ -273,7 +273,7 @@ where } } -impl Collectable for EventValues +impl Collectable for ScalarEvents where NTY: NumOps, { @@ -467,7 +467,7 @@ impl TimeBinnableTypeAggregator for EventValuesAggregator where NTY: NumOps, { - type Input = EventValues; + type Input = ScalarEvents; type Output = MinMaxAvgBins; fn range(&self) -> &NanoRange { @@ -493,7 +493,7 @@ where } } -impl EventAppendable for EventValues +impl EventAppendable for ScalarEvents where NTY: NumOps, {