pub trait DataSource: Send + Sync {
// Required methods
fn source_id(&self) -> &str;
fn fetch_batch<'life0, 'async_trait>(
&'life0 self,
cursor: Option<String>,
batch_size: usize,
) -> Pin<Box<dyn Future<Output = Result<(Vec<DataRecord>, Option<String>)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn total_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<u64>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Trait for data sources that can be ingested
Required Methods§
Sourcefn fetch_batch<'life0, 'async_trait>(
&'life0 self,
cursor: Option<String>,
batch_size: usize,
) -> Pin<Box<dyn Future<Output = Result<(Vec<DataRecord>, Option<String>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fetch_batch<'life0, 'async_trait>(
&'life0 self,
cursor: Option<String>,
batch_size: usize,
) -> Pin<Box<dyn Future<Output = Result<(Vec<DataRecord>, Option<String>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch a batch of records starting from cursor