summaryrefslogblamecommitdiffstats
path: root/native/src/subscription/events.rs
blob: 7d33166ef43b57cdad819db0ea332048719798fc (plain) (tree)
1
2
3
4
5
6
7
8
9



                                        
                                             


                  
                                       










                                                   
                                           


                    
use crate::{
    subscription::{EventStream, Recipe},
    Event, Hasher,
};
use iced_futures::futures::stream::BoxStream;

pub struct Events;

impl Recipe<Hasher, Event> 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,
    ) -> BoxStream<'static, Self::Output> {
        event_stream
    }
}