This commit is contained in:
Dominik Werder
2023-04-19 15:47:37 +02:00
parent 868f4b014a
commit f959f04399
8 changed files with 174 additions and 31 deletions

View File

@@ -20,7 +20,7 @@ pub trait TimeBins {
fn ts_min_max(&self) -> Option<(u64, u64)>;
}
pub trait TimeBinnerTy: fmt::Debug + Unpin {
pub trait TimeBinnerTy: fmt::Debug + Send + Unpin {
type Input: fmt::Debug;
type Output: fmt::Debug;
@@ -44,7 +44,7 @@ pub trait TimeBinnerTy: fmt::Debug + Unpin {
fn empty(&self) -> Option<Self::Output>;
}
pub trait TimeBinnableTy: fmt::Debug + Sized {
pub trait TimeBinnableTy: fmt::Debug + Send + Sized {
type TimeBinner: TimeBinnerTy<Input = Self>;
fn time_binner_new(&self, binrange: BinnedRangeEnum, do_time_weight: bool) -> Self::TimeBinner;

View File

@@ -157,6 +157,22 @@ impl TimeBinnableStreamTrait for TimeBinnableStreamBox {}
pub struct CollectableStreamBox(pub Pin<Box<dyn CollectableStreamTrait>>);
impl Stream for CollectableStreamBox {
type Item = Sitemty<Box<dyn Collectable>>;
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> {
self.0.poll_next_unpin(cx)
}
}
impl WithTransformProperties for CollectableStreamBox {
fn query_transform_properties(&self) -> TransformProperties {
todo!()
}
}
impl CollectableStreamTrait for CollectableStreamBox {}
impl<T> WithTransformProperties for stream::Empty<T> {
fn query_transform_properties(&self) -> TransformProperties {
todo!()
@@ -169,3 +185,5 @@ where
stream::Empty<T>: Stream<Item = Sitemty<Box<dyn Collectable>>>,
{
}
impl<T> CollectableStreamTrait for Pin<Box<T>> where T: CollectableStreamTrait {}