Skip to main content

DispatchEvent

Trait DispatchEvent 

Source
pub trait DispatchEvent<Ctx> {
    type Error;
    type Future<'s>: Future<Output = Result<StreamEvents, Self::Error>>
       where Self: 's,
             Ctx: 's;

    // Required method
    fn dispatch_event<'s>(
        &'s mut self,
        ev: Event,
        ctx: &'s mut Ctx,
    ) -> Result<Self::Future<'s>, (Event, &'s mut Ctx)>;
}

Required Associated Types§

Source

type Error

Source

type Future<'s>: Future<Output = Result<StreamEvents, Self::Error>> where Self: 's, Ctx: 's

Required Methods§

Source

fn dispatch_event<'s>( &'s mut self, ev: Event, ctx: &'s mut Ctx, ) -> Result<Self::Future<'s>, (Event, &'s mut Ctx)>

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§

Source§

impl<Ctx, D1, D2> DispatchEvent<Ctx> for Intercept<D1, D2>
where D1: DispatchEvent<Ctx>, D2: DispatchEvent<Ctx, Error = D1::Error>,

Source§

type Error = <D1 as DispatchEvent<Ctx>>::Error

Source§

type Future<'s> = Either<<D1 as DispatchEvent<Ctx>>::Future<'s>, <D2 as DispatchEvent<Ctx>>::Future<'s>> where Self: 's, Ctx: 's

Source§

impl<Ctx, E, F> DispatchEvent<Ctx> for Fallback<F>

Source§

type Error = E

Source§

type Future<'s> = Pin<Box<dyn Future<Output = Result<StreamEvents, E>> + 's>> where Self: 's, Ctx: 's

Source§

impl<Ctx, Ev, E, F> DispatchEvent<Ctx> for Match<Ev, F>
where Ev: EventData, F: AsyncFnMut(Arc<Ev>, &mut Ctx) -> Result<StreamEvents, E>,

Source§

type Error = E

Source§

type Future<'s> = Pin<Box<dyn Future<Output = Result<StreamEvents, E>> + 's>> where Self: 's, Ctx: 's