rtlola_io_plugins/
inputs.rs1#[cfg(feature = "csv_plugin")]
2pub mod csv_plugin;
3
4#[cfg(feature = "pcap_plugin")]
5pub mod pcap_plugin;
6
7#[cfg(feature = "byte_plugin")]
8pub mod byte_plugin;
9
10use std::error::Error;
11
12use rtlola_interpreter::input::{AssociatedEventFactory, EventFactory};
13use rtlola_interpreter::time::TimeRepresentation;
14
15type EventResult<MappedEvent, Time, Error> = Result<Option<(MappedEvent, Time)>, Error>;
16
17pub trait EventSource<InputTime: TimeRepresentation> {
19 type Record: AssociatedEventFactory;
21 type Error: Error;
23
24 fn init_data(
26 &self,
27 ) -> Result<
28 <<Self::Record as AssociatedEventFactory>::Factory as EventFactory>::CreationData,
29 Self::Error,
30 >;
31
32 fn next_event(&mut self) -> EventResult<Self::Record, InputTime::InnerTime, Self::Error>;
35}