Trait InstrumentRegistry

Source
pub trait InstrumentRegistry: Send + Sync {
    // Required methods
    fn cache_order_mapping(
        &self,
        order_id: &str,
        instrument_id: InstrumentId,
        metadata: Option<OrderMetadata>,
    );
    fn lookup_by_order_id(&self, order_id: &str) -> Option<InstrumentId>;
    fn normalize_symbol(
        &self,
        exchange_symbol: &str,
        venue: Venue,
    ) -> SmartString;
    fn remove_mapping(&self, order_id: &str);
    fn cleanup_expired(&self);
    fn get_cache_stats(&self) -> CacheStats;
    fn clear_all(&self);
}
Expand description

Trait for unified instrument registry operations

Required Methods§

Source

fn cache_order_mapping( &self, order_id: &str, instrument_id: InstrumentId, metadata: Option<OrderMetadata>, )

Cache bidirectional order ID to instrument mapping

Source

fn lookup_by_order_id(&self, order_id: &str) -> Option<InstrumentId>

Lookup instrument ID by order ID

Source

fn normalize_symbol(&self, exchange_symbol: &str, venue: Venue) -> SmartString

Normalize exchange-specific symbol to standard format

Source

fn remove_mapping(&self, order_id: &str)

Remove order mapping (e.g., when order is fully filled)

Source

fn cleanup_expired(&self)

Cleanup expired entries

Source

fn get_cache_stats(&self) -> CacheStats

Get cache statistics

Source

fn clear_all(&self)

Clear all mappings (for testing)

Implementors§