EventSource

Trait EventSource 

Source
pub trait EventSource<EVT: Send + Sync + 'static> {
    // Required method
    fn event_stream(&self) -> EventStream<EVT>;
}
Expand description

Standartized interface for structures providing sream of events of specified type.

Typically this trait is implemented like this:

struct NumericSource {
    stream: EventStreams<usize>
}

impl EventSource<usize> for NumericSource {
  fn event_stream(&self) -> EventStream<usize> {
    self.stream.create_event_stream()
  }
}

Required Methods§

Implementations on Foreign Types§

Source§

impl<EVT: Send + Sync + 'static, T: EventSource<EVT>> EventSource<EVT> for Arc<T>

Implementors§