Skip to main content

QuoteProvider

Trait QuoteProvider 

Source
pub trait QuoteProvider: ProviderCore {
    // Required method
    fn fetch_quote<'life0, 'life1, 'async_trait>(
        &'life0 self,
        symbol: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<QuoteSummaryResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn fetch_quotes_batch<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _: &'life1 [&'life2 str],
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, QuoteSummaryResponse)>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn fetch_unified_snapshot<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _symbols: &'life1 [&'life2 str],
    ) -> Pin<Box<dyn Future<Output = Result<Vec<MarketSnapshot>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
}
Expand description

crate::Capability::QUOTE — single and batch equity quotes.

Required Methods§

Source

fn fetch_quote<'life0, 'life1, 'async_trait>( &'life0 self, symbol: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<QuoteSummaryResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch every quote module this provider serves for one symbol.

Provided Methods§

Source

fn fetch_quotes_batch<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _: &'life1 [&'life2 str], ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, QuoteSummaryResponse)>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Fetch quotes for multiple symbols in a single request. Returns (symbol, QuoteSummaryResponse) pairs — only partially populated (price module only) since batch endpoints don’t return full quoteSummary data.

Source

fn fetch_unified_snapshot<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _symbols: &'life1 [&'life2 str], ) -> Pin<Box<dyn Future<Output = Result<Vec<MarketSnapshot>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Fetch a snapshot for symbols spanning several asset classes in one request. Rows the provider could not resolve are returned with error set rather than dropped.

NOTE: Polygon is the only cross-asset snapshot among the providers integrated here. The keyless sources are each single-asset-class, so reproducing this means fanning out per class and inventing a merge.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§