pub struct MarketDataService;Implementations§
Source§impl MarketDataService
impl MarketDataService
Sourcepub fn apply_price(
&self,
store: &mut PriceStore,
instrument: Instrument,
price: f64,
)
pub fn apply_price( &self, store: &mut PriceStore, instrument: Instrument, price: f64, )
Updates the latest known execution price for an instrument.
Example:
- incoming BTCUSDT tick at
50000.0 - stored as the current execution price context for BTCUSDT
pub fn refresh_price<E: ExchangeFacade<Error = ExchangeError>>( &self, exchange: &E, store: &mut PriceStore, instrument: Instrument, market: Market, ) -> Result<f64, ExchangeError>
pub fn current_price( &self, store: &impl PriceSource, instrument: &Instrument, ) -> Option<f64>
Trait Implementations§
Source§impl Debug for MarketDataService
impl Debug for MarketDataService
Source§impl Default for MarketDataService
impl Default for MarketDataService
Source§fn default() -> MarketDataService
fn default() -> MarketDataService
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MarketDataService
impl RefUnwindSafe for MarketDataService
impl Send for MarketDataService
impl Sync for MarketDataService
impl Unpin for MarketDataService
impl UnsafeUnpin for MarketDataService
impl UnwindSafe for MarketDataService
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more