This commit is contained in:
Dominik Werder
2021-06-08 23:25:06 +02:00
parent 7b40938427
commit ce86eb9870
4 changed files with 185 additions and 104 deletions
+2
View File
@@ -21,6 +21,7 @@ use std::pin::Pin;
use std::task::{Context, Poll};
use tokio::fs::File;
// TODO no longer needed
pub struct DefaultScalarEventsTimeBinner<VT> {
_m1: PhantomData<VT>,
}
@@ -38,6 +39,7 @@ where
}
}
// TODO no longer needed
pub struct DefaultSingleXBinTimeBinner<VT> {
_m1: PhantomData<VT>,
}
+16
View File
@@ -3,6 +3,7 @@ use crate::streamlog::LogItem;
use err::Error;
use netpod::EventDataReadStats;
use serde::{Deserialize, Serialize};
use std::any::Any;
#[derive(Debug, Serialize, Deserialize)]
pub enum StatsItem {
@@ -32,6 +33,21 @@ pub trait Collectable {
fn append_to(&self, collected: &mut Self::Collected);
}
pub trait Collectable2: Any {
fn as_any_ref(&self) -> &dyn Any;
fn append(&mut self, src: &dyn Any);
}
pub trait CollectionSpec2 {
// TODO Can I use here associated types and return concrete types?
// Probably not object safe.
fn empty(&self) -> Box<dyn Collectable2>;
}
pub trait CollectionSpecMaker2 {
fn spec(bin_count_exp: u32) -> Box<dyn CollectionSpec2>;
}
pub trait ToJsonResult {
type Output;
fn to_json_result(&self) -> Result<Self::Output, Error>;