Skip to main content

MarketProvider

Trait MarketProvider 

Source
pub trait MarketProvider: ProviderCore {
    // Required method
    fn fetch_market_movers<'life0, 'async_trait>(
        &'life0 self,
        direction: MoverDirection,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<MoverQuote>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn fetch_sector_performance<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<SectorPerformance>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn fetch_sector_performance_history<'life0, 'async_trait>(
        &'life0 self,
        _limit: u32,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<SectorPerformanceHistory>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn fetch_sector_pe<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<SectorPe>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn fetch_industry_pe<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<IndustryPe>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

crate::Capability::MARKET — sector/industry performance and movers.

Movers is the required primary (every current implementor serves it); the sector/industry statistics default to NotSupported since coverage is ragged (FMP serves all of them; Yahoo and Alpha Vantage only movers).

Required Methods§

Source

fn fetch_market_movers<'life0, 'async_trait>( &'life0 self, direction: MoverDirection, ) -> Pin<Box<dyn Future<Output = Result<Vec<MoverQuote>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch the market movers list for direction.

Provided Methods§

Source

fn fetch_sector_performance<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<SectorPerformance>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Fetch aggregate performance for every sector.

Source

fn fetch_sector_performance_history<'life0, 'async_trait>( &'life0 self, _limit: u32, ) -> Pin<Box<dyn Future<Output = Result<Vec<SectorPerformanceHistory>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Fetch historical aggregate sector performance, most recent first.

Source

fn fetch_sector_pe<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<SectorPe>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Fetch sector price/earnings ratios.

Source

fn fetch_industry_pe<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<IndustryPe>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Fetch industry price/earnings ratios.

NOTE: FMP is the only route among the providers integrated here. Yahoo’s screener fan-out backs fetch_sector_pe across 11 sectors, but industries run to roughly 160 and the thin ones carry too few sampled P/Es to aggregate into a publishable number.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§