nautilus_common::cache::database

Trait CacheDatabaseAdapter

Source
pub trait CacheDatabaseAdapter {
Show 50 methods // Required methods fn close(&mut self) -> Result<()>; fn flush(&mut self) -> Result<()>; fn load(&self) -> Result<HashMap<String, Bytes>>; fn load_currencies(&mut self) -> Result<HashMap<Ustr, Currency>>; fn load_instruments( &mut self, ) -> Result<HashMap<InstrumentId, InstrumentAny>>; fn load_synthetics( &mut self, ) -> Result<HashMap<InstrumentId, SyntheticInstrument>>; fn load_accounts(&mut self) -> Result<HashMap<AccountId, AccountAny>>; fn load_orders(&mut self) -> Result<HashMap<ClientOrderId, OrderAny>>; fn load_positions(&mut self) -> Result<HashMap<PositionId, Position>>; fn load_index_order_position( &self, ) -> Result<HashMap<ClientOrderId, Position>>; fn load_index_order_client( &self, ) -> Result<HashMap<ClientOrderId, ClientId>>; fn load_currency(&self, code: &Ustr) -> Result<Option<Currency>>; fn load_instrument( &self, instrument_id: &InstrumentId, ) -> Result<Option<InstrumentAny>>; fn load_synthetic( &self, instrument_id: &InstrumentId, ) -> Result<SyntheticInstrument>; fn load_account(&self, account_id: &AccountId) -> Result<Option<AccountAny>>; fn load_order( &self, client_order_id: &ClientOrderId, ) -> Result<Option<OrderAny>>; fn load_position(&self, position_id: &PositionId) -> Result<Position>; fn load_actor( &self, component_id: &ComponentId, ) -> Result<HashMap<String, Bytes>>; fn load_strategy( &self, strategy_id: &StrategyId, ) -> Result<HashMap<String, Bytes>>; fn load_signals(&self, name: &str) -> Result<Vec<Signal>>; fn load_custom_data(&self, data_type: &DataType) -> Result<Vec<CustomData>>; fn load_quotes( &self, instrument_id: &InstrumentId, ) -> Result<Vec<QuoteTick>>; fn load_trades( &self, instrument_id: &InstrumentId, ) -> Result<Vec<TradeTick>>; fn load_bars(&self, instrument_id: &InstrumentId) -> Result<Vec<Bar>>; fn add(&self, key: String, value: Bytes) -> Result<()>; fn add_currency(&self, currency: &Currency) -> Result<()>; fn add_instrument(&self, instrument: &InstrumentAny) -> Result<()>; fn add_synthetic(&self, synthetic: &SyntheticInstrument) -> Result<()>; fn add_account(&self, account: &AccountAny) -> Result<()>; fn add_order( &self, order: &OrderAny, client_id: Option<ClientId>, ) -> Result<()>; fn add_position(&self, position: &Position) -> Result<()>; fn add_position_snapshot(&self, snapshot: &PositionSnapshot) -> Result<()>; fn add_order_book(&self, order_book: &OrderBook) -> Result<()>; fn add_signal(&self, signal: &Signal) -> Result<()>; fn add_custom_data(&self, data: &CustomData) -> Result<()>; fn add_quote(&self, quote: &QuoteTick) -> Result<()>; fn add_trade(&self, trade: &TradeTick) -> Result<()>; fn add_bar(&self, bar: &Bar) -> Result<()>; fn delete_actor(&self, component_id: &ComponentId) -> Result<()>; fn delete_strategy(&self, component_id: &StrategyId) -> Result<()>; fn index_venue_order_id( &self, client_order_id: ClientOrderId, venue_order_id: VenueOrderId, ) -> Result<()>; fn index_order_position( &self, client_order_id: ClientOrderId, position_id: PositionId, ) -> Result<()>; fn update_actor(&self) -> Result<()>; fn update_strategy(&self) -> Result<()>; fn update_account(&self, account: &AccountAny) -> Result<()>; fn update_order(&self, order_event: &OrderEventAny) -> Result<()>; fn update_position(&self, position: &Position) -> Result<()>; fn snapshot_order_state(&self, order: &OrderAny) -> Result<()>; fn snapshot_position_state(&self, position: &Position) -> Result<()>; fn heartbeat(&self, timestamp: UnixNanos) -> Result<()>;
}

Required Methods§

Source

fn close(&mut self) -> Result<()>

Source

fn flush(&mut self) -> Result<()>

Source

fn load(&self) -> Result<HashMap<String, Bytes>>

Source

fn load_currencies(&mut self) -> Result<HashMap<Ustr, Currency>>

Source

fn load_instruments(&mut self) -> Result<HashMap<InstrumentId, InstrumentAny>>

Source

fn load_synthetics( &mut self, ) -> Result<HashMap<InstrumentId, SyntheticInstrument>>

Source

fn load_accounts(&mut self) -> Result<HashMap<AccountId, AccountAny>>

Source

fn load_orders(&mut self) -> Result<HashMap<ClientOrderId, OrderAny>>

Source

fn load_positions(&mut self) -> Result<HashMap<PositionId, Position>>

Source

fn load_index_order_position(&self) -> Result<HashMap<ClientOrderId, Position>>

Source

fn load_index_order_client(&self) -> Result<HashMap<ClientOrderId, ClientId>>

Source

fn load_currency(&self, code: &Ustr) -> Result<Option<Currency>>

Source

fn load_instrument( &self, instrument_id: &InstrumentId, ) -> Result<Option<InstrumentAny>>

Source

fn load_synthetic( &self, instrument_id: &InstrumentId, ) -> Result<SyntheticInstrument>

Source

fn load_account(&self, account_id: &AccountId) -> Result<Option<AccountAny>>

Source

fn load_order( &self, client_order_id: &ClientOrderId, ) -> Result<Option<OrderAny>>

Source

fn load_position(&self, position_id: &PositionId) -> Result<Position>

Source

fn load_actor( &self, component_id: &ComponentId, ) -> Result<HashMap<String, Bytes>>

Source

fn load_strategy( &self, strategy_id: &StrategyId, ) -> Result<HashMap<String, Bytes>>

Source

fn load_signals(&self, name: &str) -> Result<Vec<Signal>>

Source

fn load_custom_data(&self, data_type: &DataType) -> Result<Vec<CustomData>>

Source

fn load_quotes(&self, instrument_id: &InstrumentId) -> Result<Vec<QuoteTick>>

Source

fn load_trades(&self, instrument_id: &InstrumentId) -> Result<Vec<TradeTick>>

Source

fn load_bars(&self, instrument_id: &InstrumentId) -> Result<Vec<Bar>>

Source

fn add(&self, key: String, value: Bytes) -> Result<()>

Source

fn add_currency(&self, currency: &Currency) -> Result<()>

Source

fn add_instrument(&self, instrument: &InstrumentAny) -> Result<()>

Source

fn add_synthetic(&self, synthetic: &SyntheticInstrument) -> Result<()>

Source

fn add_account(&self, account: &AccountAny) -> Result<()>

Source

fn add_order(&self, order: &OrderAny, client_id: Option<ClientId>) -> Result<()>

Source

fn add_position(&self, position: &Position) -> Result<()>

Source

fn add_position_snapshot(&self, snapshot: &PositionSnapshot) -> Result<()>

Source

fn add_order_book(&self, order_book: &OrderBook) -> Result<()>

Source

fn add_signal(&self, signal: &Signal) -> Result<()>

Source

fn add_custom_data(&self, data: &CustomData) -> Result<()>

Source

fn add_quote(&self, quote: &QuoteTick) -> Result<()>

Source

fn add_trade(&self, trade: &TradeTick) -> Result<()>

Source

fn add_bar(&self, bar: &Bar) -> Result<()>

Source

fn delete_actor(&self, component_id: &ComponentId) -> Result<()>

Source

fn delete_strategy(&self, component_id: &StrategyId) -> Result<()>

Source

fn index_venue_order_id( &self, client_order_id: ClientOrderId, venue_order_id: VenueOrderId, ) -> Result<()>

Source

fn index_order_position( &self, client_order_id: ClientOrderId, position_id: PositionId, ) -> Result<()>

Source

fn update_actor(&self) -> Result<()>

Source

fn update_strategy(&self) -> Result<()>

Source

fn update_account(&self, account: &AccountAny) -> Result<()>

Source

fn update_order(&self, order_event: &OrderEventAny) -> Result<()>

Source

fn update_position(&self, position: &Position) -> Result<()>

Source

fn snapshot_order_state(&self, order: &OrderAny) -> Result<()>

Source

fn snapshot_position_state(&self, position: &Position) -> Result<()>

Source

fn heartbeat(&self, timestamp: UnixNanos) -> Result<()>

Implementors§