Trait rtlola_input_plugins::EventSource

source ·
pub trait EventSource<InputTime: TimeRepresentation> {
    type Rec: Record;
    type Error: Error;

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

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

Required Associated Types§

Required Methods§

source

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

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

source

fn next_event( &mut self, ) -> Result<Option<(Self::Rec, 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§

source§

impl<InputTime: TimeRepresentation> EventSource<InputTime> for CsvEventSource<InputTime>

source§

impl<InputTime: TimeRepresentation> EventSource<InputTime> for PcapEventSource<InputTime>