diff options
Diffstat (limited to 'native/src/subscription/events.rs')
-rw-r--r-- | native/src/subscription/events.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/native/src/subscription/events.rs b/native/src/subscription/events.rs new file mode 100644 index 00000000..b7301828 --- /dev/null +++ b/native/src/subscription/events.rs @@ -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 + } +} |