pub trait EventSource<Event> {
    type Source: Stream<Item = Event> + 'static;

    // Required method
    fn subscribe(&self) -> Self::Source;
}
Expand description

Event source

An event source is something you can get a stream of events from.

Required Associated Types§

source

type Source: Stream<Item = Event> + 'static

Type of event stream you get from this event source.

Required Methods§

source

fn subscribe(&self) -> Self::Source

Get a stream of events from the event source.

Implementors§

source§

impl<E: Clone + 'static> EventSource<E> for Broadcast<E>

§

type Source = Receiver<E>

source§

impl<E: Clone + 'static> EventSource<E> for Ring<E>

§

type Source = Receiver<E>

source§

impl<E: Iterator + Default + 'static> EventSource<<E as Iterator>::Item> for Sender<E>

§

type Source = impl Stream<Item = <E as Iterator>::Item> + FusedStream + Unpin

source§

impl<G: 'static> EventSource<GlobalsUpdate<G>> for GlobalStore<G>

source§

impl<O: AnyObject> EventSource<StoreUpdate> for Store<O>

§

type Source = impl Stream<Item = StoreUpdate> + 'static