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§
Sourcefn get_all_instruments_sync(&self) -> Result<Vec<InstrumentRecord>>
fn get_all_instruments_sync(&self) -> Result<Vec<InstrumentRecord>>
Load all instruments regardless of status.
Sourcefn get_instruments_by_status_sync(
&self,
status: &str,
) -> Result<Vec<InstrumentRecord>>
fn get_instruments_by_status_sync( &self, status: &str, ) -> Result<Vec<InstrumentRecord>>
Load instruments filtered by status (e.g. “ACTIVE”, “PENDING_SETTLEMENT”).
Sourcefn get_instrument_status_counts_sync(&self) -> Result<Vec<(String, i64)>>
fn get_instrument_status_counts_sync(&self) -> Result<Vec<(String, i64)>>
Count instruments grouped by status.
Sourcefn get_markets_expiring_within_sync(&self, seconds: i64) -> Result<i64>
fn get_markets_expiring_within_sync(&self, seconds: i64) -> Result<i64>
Count markets (underlying+expiry) expiring within seconds from now.
Provided Methods§
Sourcefn get_active_instruments_expired_by_sync(
&self,
now_ts_secs: u64,
) -> Result<Vec<InstrumentRecord>>
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.