summaryrefslogtreecommitdiffstats
path: root/native/src/subscription/events.rs
blob: b7301828733d5b8aa92061ed61f19e7f56db19db (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use crate::{
    subscription::{EventStream, Recipe},
    Event, Hasher,
};

pub struct Events;

impl Recipe<Hasher, EventStream> for Events {
    type Output = Event;

    fn hash(&self, state: &mut Hasher) {
        use std::hash::Hash;

        std::any::TypeId::of::<Self>().hash(state);
    }

    fn stream(
        self: Box<Self>,
        event_stream: EventStream,
    ) -> futures::stream::BoxStream<'static, Self::Output> {
        event_stream
    }
}