Skip to main content

ChartProvider

Trait ChartProvider 

Source
pub trait ChartProvider: ProviderCore {
    // Required method
    fn fetch_chart<'life0, 'life1, 'async_trait>(
        &'life0 self,
        symbol: &'life1 str,
        interval: Interval,
        range: TimeRange,
    ) -> Pin<Box<dyn Future<Output = Result<Chart>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn fetch_chart_range<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _symbol: &'life1 str,
        _interval: Interval,
        _start: i64,
        _end: i64,
    ) -> Pin<Box<dyn Future<Output = Result<Chart>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn fetch_spark<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _symbols: &'life1 [&'life2 str],
        _interval: Interval,
        _range: TimeRange,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Spark)>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn fetch_grouped_daily<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _date: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Candle)>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn fetch_crypto_grouped_daily<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _date: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Candle)>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn fetch_forex_grouped_daily<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _date: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Candle)>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

crate::Capability::CHART — historical OHLCV candles and sparklines.

Required Methods§

Source

fn fetch_chart<'life0, 'life1, 'async_trait>( &'life0 self, symbol: &'life1 str, interval: Interval, range: TimeRange, ) -> Pin<Box<dyn Future<Output = Result<Chart>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch OHLCV candles at one interval over one range.

Provided Methods§

Source

fn fetch_chart_range<'life0, 'life1, 'async_trait>( &'life0 self, _symbol: &'life1 str, _interval: Interval, _start: i64, _end: i64, ) -> Pin<Box<dyn Future<Output = Result<Chart>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch OHLCV candles between two Unix timestamps.

Source

fn fetch_spark<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _symbols: &'life1 [&'life2 str], _interval: Interval, _range: TimeRange, ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Spark)>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Fetch lightweight sparkline data for multiple symbols in a single request. Returns successfully-parsed (symbol, Spark) pairs; callers fill in missing-symbol errors for any symbol absent from the result.

Source

fn fetch_grouped_daily<'life0, 'life1, 'async_trait>( &'life0 self, _date: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Candle)>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch grouped daily OHLCV bars for every stock ticker on date (YYYY-MM-DD) in a single request — market-wide rather than symbol-scoped. Returns (symbol, candle) pairs.

NOTE: no keyless provider in this crate publishes a market-wide bulk EOD file for stocks; this stays a Polygon-only capability.

Source

fn fetch_crypto_grouped_daily<'life0, 'life1, 'async_trait>( &'life0 self, _date: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Candle)>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch grouped daily OHLCV bars for every crypto ticker on date (YYYY-MM-DD) in a single request. Returns (symbol, candle) pairs.

NOTE: Binance’s 24hr ticker endpoint covers every symbol in one call but only as a rolling now-minus-24h window, not an arbitrary historical date — the wrong shape for this operation, so it stays Polygon-only.

Source

fn fetch_forex_grouped_daily<'life0, 'life1, 'async_trait>( &'life0 self, _date: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Candle)>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch grouped daily OHLCV bars for every forex ticker on date (YYYY-MM-DD) in a single request. Returns (symbol, candle) pairs.

NOTE: Frankfurter serves every ECB reference rate for a historical date in one call, but only a single daily fixing rate, not OHLCV candles — the wrong shape for this operation, so it stays Polygon-only.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§