evno 1.0.2

A high-performance event bus for asynchronous tasks and event-driven systems.
Documentation
use crate::event::Event;

#[trait_variant::make(Send)]
pub trait Step: Clone + Sync {
    type Event<E: Event>: Event;

    async fn process<E: Event>(self, event: E) -> Self::Event<E>;
}

#[derive(Debug, Clone)]
pub struct Identity;

impl Step for Identity {
    type Event<E: Event> = E;

    #[inline]
    async fn process<E: Event>(self, event: E) -> Self::Event<E> {
        event
    }
}