Expand description

Crate allows to automatically derive EventSink trait for any structure implementing EventSintExt

Usage sample:

use std::sync::Arc;
use async_trait::async_trait;
use std::borrow::Cow;
use async_event_streams::{EventBox, EventSink, EventSinkExt};
use async_event_streams_derive::EventSink;

#[derive(EventSink)]
#[event_sink(event=Event)]
struct Sink;

#[derive(Clone)]
struct Event;

#[async_trait]
impl EventSinkExt<Event> for Sink {
    type Error = ();
    async fn on_event<'a>(&'a self, event: Cow<'a, Event>, source: Option<Arc<EventBox>>) -> Result<(), Self::Error> {
        todo!()
    }
}

Derive Macros