iced/native/src/subscription/events.rs
Héctor Ramón Jiménez 338fff35ac Make subscription::Recipe cross-platform
By removing the `Send` requirement when targetting Wasm
2020-03-26 14:55:02 +01:00

24 lines
461 B
Rust

use crate::{
subscription::{EventStream, Recipe},
Event, Hasher,
};
use iced_futures::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<Self::Output> {
event_stream
}
}