Skip to main content

MarketDataSource

Trait MarketDataSource 

pub trait MarketDataSource: Send + Sync {
    // Required method
    fn fetch(
        &self,
        demand: &Demand,
        as_of: NaiveDate,
    ) -> Result<MarketData, SourceError>;
}
Expand description

A source of market data — per snapshot, one call carrying the whole demand.

Required Methods§

fn fetch( &self, demand: &Demand, as_of: NaiveDate, ) -> Result<MarketData, SourceError>

What the source holds of demand, observed on or before as_of. Whatever it does not hold it leaves out.

§Errors

SourceError where the source itself failed; never for a key it does not hold.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§