This commit is contained in:
Dominik Werder
2023-04-17 15:16:44 +02:00
parent 565999e7c7
commit b1c0aa9054
8 changed files with 81 additions and 49 deletions

View File

@@ -135,12 +135,12 @@ where
}
// TODO rename to `Typed`
pub trait CollectableType: fmt::Debug + AsAnyRef + AsAnyMut + TypeName {
pub trait CollectableType: fmt::Debug + AsAnyRef + AsAnyMut + TypeName + Send {
type Collector: CollectorType<Input = Self>;
fn new_collector() -> Self::Collector;
}
pub trait Collectable: fmt::Debug + AsAnyRef + AsAnyMut + TypeName {
pub trait Collectable: fmt::Debug + AsAnyRef + AsAnyMut + TypeName + Send {
fn new_collector(&self) -> Box<dyn Collector>;
}

View File

@@ -1,3 +1,4 @@
use crate::collect_s::Collectable;
use crate::collect_s::Collected;
use crate::streamitem::RangeCompletableItem;
use crate::streamitem::Sitemty;
@@ -105,18 +106,4 @@ where
}
}
// TODO these must return type which can take events as input.
pub struct TransformedCollectedStream(pub Pin<Box<dyn Future<Output = Result<Box<dyn Collected>, Error>>>>);
impl WithTransformProperties for TransformedCollectedStream {
fn query_transform_properties(&self) -> TransformProperties {
todo!()
}
}
impl EventTransform for TransformedCollectedStream {
fn transform(&mut self, src: Box<dyn Events>) -> Box<dyn Events> {
todo!()
}
}
pub struct CollectableStream(pub Pin<Box<dyn Stream<Item = Sitemty<Box<dyn Collectable>>> + Send>>);