Skip to main content

InstrumentReader

Trait InstrumentReader 

Source
pub trait InstrumentReader: Send + Sync {
    // Required methods
    fn get_all_instruments_sync(&self) -> Result<Vec<InstrumentRecord>>;
    fn get_instruments_by_status_sync(
        &self,
        status: &str,
    ) -> Result<Vec<InstrumentRecord>>;
    fn get_instrument_status_counts_sync(&self) -> Result<Vec<(String, i64)>>;
    fn get_markets_expiring_within_sync(&self, seconds: i64) -> Result<i64>;

    // Provided method
    fn get_active_instruments_expired_by_sync(
        &self,
        now_ts_secs: u64,
    ) -> Result<Vec<InstrumentRecord>> { ... }
}
Expand description

Read-only instrument queries.

Required Methods§

Source

fn get_all_instruments_sync(&self) -> Result<Vec<InstrumentRecord>>

Load all instruments regardless of status.

Source

fn get_instruments_by_status_sync( &self, status: &str, ) -> Result<Vec<InstrumentRecord>>

Load instruments filtered by status (e.g. “ACTIVE”, “PENDING_SETTLEMENT”).

Source

fn get_instrument_status_counts_sync(&self) -> Result<Vec<(String, i64)>>

Count instruments grouped by status.

Source

fn get_markets_expiring_within_sync(&self, seconds: i64) -> Result<i64>

Count markets (underlying+expiry) expiring within seconds from now.

Provided Methods§

Source

fn get_active_instruments_expired_by_sync( &self, now_ts_secs: u64, ) -> Result<Vec<InstrumentRecord>>

Load active instruments whose expiry timestamp is at or before now_ts_secs.

Implementors§