Make iced_native subscription input opaque
This commit is contained in:
parent
ba06d458d3
commit
293314405f
4 changed files with 36 additions and 28 deletions
23
native/src/subscription/events.rs
Normal file
23
native/src/subscription/events.rs
Normal file
|
|
@ -0,0 +1,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
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue