Skip to main content

InstrumentWriter

Trait InstrumentWriter 

Source
pub trait InstrumentWriter: InstrumentReader {
    // Required methods
    fn save_market_and_instrument_sync(
        &self,
        underlying: &str,
        expiry: i64,
        instrument: &InstrumentRecord,
    ) -> Result<()>;
    fn delete_market_and_instrument_sync(&self, symbol: &str) -> Result<()>;
    fn update_instrument_status_sync(
        &self,
        symbols: &[String],
        status: &str,
    ) -> Result<usize>;
    fn transition_active_instruments_to_expired_pending_sync(
        &self,
        symbols: &[String],
    ) -> Result<usize>;
}
Expand description

Instrument mutations.

Required Methods§

Source

fn save_market_and_instrument_sync( &self, underlying: &str, expiry: i64, instrument: &InstrumentRecord, ) -> Result<()>

Persist a new instrument and its parent market. Only used for new ACTIVE instruments – status transitions on existing instruments go through update_instrument_status_sync.

Source

fn delete_market_and_instrument_sync(&self, symbol: &str) -> Result<()>

Delete an instrument and its parent market row.

Source

fn update_instrument_status_sync( &self, symbols: &[String], status: &str, ) -> Result<usize>

Batch-update instrument status. Returns number of rows updated.

Source

fn transition_active_instruments_to_expired_pending_sync( &self, symbols: &[String], ) -> Result<usize>

Transition only instruments that are still ACTIVE to EXPIRED_PENDING_PRICE. Returns number of rows updated.

Implementors§