fluxus_sources/
lib.rs

1pub mod csv;
2pub mod generator;
3
4pub use csv::CsvSource;
5
6use fluxus_utils::models::{Record, StreamResult};
7pub use generator::GeneratorSource;
8
9use async_trait::async_trait;
10
11/// Source trait defines the interface for data sources
12#[async_trait]
13pub trait Source<T> {
14    /// Initialize the source
15    async fn init(&mut self) -> StreamResult<()>;
16
17    /// Read the next record from the source
18    async fn next(&mut self) -> StreamResult<Option<Record<T>>>;
19
20    /// Close the source and release resources
21    async fn close(&mut self) -> StreamResult<()>;
22}