pub trait DataProvider: Send + Sync {
// Required methods
fn load(&self, query: &DataQuery) -> Result<DataFrame, DataError>;
fn has_data(&self, symbol: &str, timeframe: &Timeframe) -> bool;
fn symbols(&self) -> Vec<String>;
// Provided method
fn timeframes(&self, symbol: &str) -> Vec<Timeframe> { ... }
}Expand description
Trait for data providers
Implementations of this trait provide access to time series data. The trait is designed to be simple and synchronous - async operations should be handled by the implementation internally.
Required Methods§
Sourcefn load(&self, query: &DataQuery) -> Result<DataFrame, DataError>
fn load(&self, query: &DataQuery) -> Result<DataFrame, DataError>
Load data matching the query
Returns a DataFrame with the requested data, or an error if the data is not available.
Provided Methods§
Sourcefn timeframes(&self, symbol: &str) -> Vec<Timeframe>
fn timeframes(&self, symbol: &str) -> Vec<Timeframe>
List available timeframes for a symbol