2019-12-14 04:49:13 +01:00
|
|
|
use crate::{
|
|
|
|
|
subscription::{EventStream, Recipe},
|
|
|
|
|
Event, Hasher,
|
|
|
|
|
};
|
2020-03-26 14:55:02 +01:00
|
|
|
use iced_futures::BoxStream;
|
2019-12-14 04:49:13 +01:00
|
|
|
|
|
|
|
|
pub struct Events;
|
|
|
|
|
|
2020-01-19 08:36:44 +01:00
|
|
|
impl Recipe<Hasher, Event> for Events {
|
2019-12-14 04:49:13 +01:00
|
|
|
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,
|
2020-03-26 14:55:02 +01:00
|
|
|
) -> BoxStream<Self::Output> {
|
2019-12-14 04:49:13 +01:00
|
|
|
event_stream
|
|
|
|
|
}
|
|
|
|
|
}
|