WIP
This commit is contained in:
@@ -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>,
|
||||
}
|
||||
|
||||
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user