Trait vector_core::transform::TaskTransform

source ·
pub trait TaskTransform<T: EventContainer + 'static>: Send + 'static {
    // Required method
    fn transform(
        self: Box<Self>,
        task: Pin<Box<dyn Stream<Item = T> + Send>>,
    ) -> Pin<Box<dyn Stream<Item = T> + Send>>;

    // Provided method
    fn transform_events(
        self: Box<Self>,
        task: Pin<Box<dyn Stream<Item = Event> + Send>>,
    ) -> Pin<Box<dyn Stream<Item = Event> + Send>>
       where T: From<Event>,
             T::IntoIter: Send { ... }
}
Expand description

Transforms that tend to be more complicated runtime style components.

These require coordination and map a stream of some T to some U.

§Invariants

  • It is an illegal invariant to implement FunctionTransform for a TaskTransform or vice versa.

Required Methods§

source

fn transform( self: Box<Self>, task: Pin<Box<dyn Stream<Item = T> + Send>>, ) -> Pin<Box<dyn Stream<Item = T> + Send>>

Provided Methods§

source

fn transform_events( self: Box<Self>, task: Pin<Box<dyn Stream<Item = Event> + Send>>, ) -> Pin<Box<dyn Stream<Item = Event> + Send>>
where T: From<Event>, T::IntoIter: Send,

Wrap the transform task to process and emit individual events. This is used to simplify testing task transforms.

Implementors§

source§

impl<T> TaskTransform<Event> for T
where T: RuntimeTransform + Send + 'static,