This commit is contained in:
Dominik Werder
2023-03-09 15:53:14 +01:00
parent f262f7e9df
commit 431d98ffea
19 changed files with 362 additions and 286 deletions
+4 -4
View File
@@ -6,7 +6,7 @@ use crate::Events;
use crate::WithLen;
use err::Error;
use netpod::BinnedRangeEnum;
use netpod::NanoRange;
use netpod::SeriesRange;
use std::fmt;
pub trait Collector: fmt::Debug + Send {
@@ -16,7 +16,7 @@ pub trait Collector: fmt::Debug + Send {
fn set_timed_out(&mut self);
fn result(
&mut self,
range: Option<NanoRange>,
range: Option<SeriesRange>,
binrange: Option<BinnedRangeEnum>,
) -> Result<Box<dyn Collected>, Error>;
}
@@ -52,7 +52,7 @@ pub trait CollectorDyn: fmt::Debug + Send {
fn result(
&mut self,
range: Option<NanoRange>,
range: Option<SeriesRange>,
binrange: Option<BinnedRangeEnum>,
) -> Result<Box<dyn Collected>, Error>;
}
@@ -95,7 +95,7 @@ impl Collector for TimeBinnedCollector {
fn result(
&mut self,
_range: Option<NanoRange>,
_range: Option<SeriesRange>,
_binrange: Option<BinnedRangeEnum>,
) -> Result<Box<dyn Collected>, Error> {
todo!()
+4 -4
View File
@@ -4,7 +4,7 @@ use crate::AsAnyRef;
use crate::WithLen;
use err::Error;
use netpod::BinnedRangeEnum;
use netpod::NanoRange;
use netpod::SeriesRange;
use serde::Serialize;
use std::any::Any;
use std::fmt;
@@ -19,7 +19,7 @@ pub trait CollectorType: Send + Unpin + WithLen {
fn set_timed_out(&mut self);
// TODO use this crate's Error instead:
fn result(&mut self, range: Option<NanoRange>, binrange: Option<BinnedRangeEnum>) -> Result<Self::Output, Error>;
fn result(&mut self, range: Option<SeriesRange>, binrange: Option<BinnedRangeEnum>) -> Result<Self::Output, Error>;
}
pub trait Collector: Send + Unpin + WithLen {
@@ -29,7 +29,7 @@ pub trait Collector: Send + Unpin + WithLen {
// TODO factor the required parameters into new struct? Generic over events or binned?
fn result(
&mut self,
range: Option<NanoRange>,
range: Option<SeriesRange>,
binrange: Option<BinnedRangeEnum>,
) -> Result<Box<dyn ToJsonResult>, Error>;
}
@@ -60,7 +60,7 @@ impl<T: CollectorType + 'static> Collector for T {
fn result(
&mut self,
range: Option<NanoRange>,
range: Option<SeriesRange>,
binrange: Option<BinnedRangeEnum>,
) -> Result<Box<dyn ToJsonResult>, Error> {
let ret = T::result(self, range, binrange)?;
+1 -1
View File
@@ -60,7 +60,7 @@ pub trait EmptyForShape {
}
pub trait Empty {
fn empty(dim0kind: Dim0Kind) -> Self;
fn empty() -> Self;
}
pub trait Appendable<STY>: Empty + WithLen {