pub trait DataSource: Send + Sync {
// Required methods
fn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<DataSourceContent>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn check_updated<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn source_type(&self) -> DataSourceType;
}Expand description
Trait for data source implementations
Required Methods§
Sourcefn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<DataSourceContent>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<DataSourceContent>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load data from the source
Sourcefn check_updated<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn check_updated<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if the source has been updated (for caching)
Sourcefn source_type(&self) -> DataSourceType
fn source_type(&self) -> DataSourceType
Get the source type