Skip to main content

EventTransform

Trait EventTransform 

Source
pub trait EventTransform: Send {
    type Input: Send;
    type Output: Send;

    // Required method
    fn transform(
        &mut self,
        event: Self::Input,
    ) -> impl Future<Output = Option<Self::Output>> + Send;
}
Expand description

Trait for event transformers (filter/map).

Required Associated Types§

Source

type Input: Send

Input event type.

Source

type Output: Send

Output event type.

Required Methods§

Source

fn transform( &mut self, event: Self::Input, ) -> impl Future<Output = Option<Self::Output>> + Send

Transform an event. Returns None to filter out the event.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§