EventSource

Trait EventSource 

Source
pub trait EventSource<InputTime: TimeRepresentation> {
    type Record: AssociatedEventFactory;
    type Error: Error;

    // Required methods
    fn init_data(
        &self,
    ) -> Result<<<Self::Record as AssociatedEventFactory>::Factory as EventFactory>::CreationData, Self::Error>;
    fn next_event(
        &mut self,
    ) -> Result<Option<(Self::Record, InputTime::InnerTime)>, Self::Error>;
}
Expand description

The main trait that has to be implemented by an input plugin

Required Associated Types§

Source

type Record: AssociatedEventFactory

Type of the Event given to the monitor

Source

type Error: Error

Error type when buildin the next Event

Required Methods§

Source

fn init_data( &self, ) -> Result<<<Self::Record as AssociatedEventFactory>::Factory as EventFactory>::CreationData, Self::Error>

Return the data needed by the monitor to initialize the input source.

Source

fn next_event( &mut self, ) -> Result<Option<(Self::Record, InputTime::InnerTime)>, Self::Error>

Queries the event source for a new Record(Event) in a blocking fashion. If there are no more records, None is returned.

Implementors§