pub struct ExecutionClientCore {
pub trader_id: TraderId,
pub client_id: ClientId,
pub venue: Venue,
pub oms_type: OmsType,
pub account_id: AccountId,
pub account_type: AccountType,
pub base_currency: Option<Currency>,
/* private fields */
}Expand description
Base implementation for execution clients providing identity and connection state.
This struct provides the foundation for all execution clients, holding client identity, connection state, and read-only cache access. Execution clients use this as a base and extend it with venue-specific implementations.
For event generation, use OrderEventFactory from nautilus_common::factories.
For live adapters, use ExecutionEventEmitter which combines event generation
with async dispatch. For backtest/sandbox, use OrderEventFactory directly
and dispatch via msgbus::send_order_event().
Fields§
§trader_id: TraderId§client_id: ClientId§venue: Venue§oms_type: OmsType§account_id: AccountId§account_type: AccountType§base_currency: Option<Currency>Implementations§
Source§impl ExecutionClientCore
impl ExecutionClientCore
Sourcepub fn new(
trader_id: TraderId,
client_id: ClientId,
venue: Venue,
oms_type: OmsType,
account_id: AccountId,
account_type: AccountType,
base_currency: Option<Currency>,
cache: impl Into<CacheView>,
) -> Self
pub fn new( trader_id: TraderId, client_id: ClientId, venue: Venue, oms_type: OmsType, account_id: AccountId, account_type: AccountType, base_currency: Option<Currency>, cache: impl Into<CacheView>, ) -> Self
Creates a new ExecutionClientCore instance.
Sourcepub fn get_order(&self, client_order_id: &ClientOrderId) -> Result<OrderAny>
pub fn get_order(&self, client_order_id: &ClientOrderId) -> Result<OrderAny>
Returns the order for the given client_order_id from the cache.
§Errors
Returns an error if the order is not found in the cache.
Sourcepub fn get_orders_for_list(
&self,
order_list: &OrderList,
) -> Result<Vec<OrderAny>>
pub fn get_orders_for_list( &self, order_list: &OrderList, ) -> Result<Vec<OrderAny>>
Returns all orders for the given order list from the cache.
§Errors
Returns an error if any order is not found in the cache.
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Returns true if the client is connected.
Sourcepub fn is_disconnected(&self) -> bool
pub fn is_disconnected(&self) -> bool
Returns true if the client is disconnected.
Sourcepub fn set_connected(&self)
pub fn set_connected(&self)
Sets the client as connected.
Sourcepub fn set_disconnected(&self)
pub fn set_disconnected(&self)
Sets the client as disconnected.
Sourcepub fn is_started(&self) -> bool
pub fn is_started(&self) -> bool
Returns true if the client has been started.
Sourcepub fn is_stopped(&self) -> bool
pub fn is_stopped(&self) -> bool
Returns true if the client has not been started.
Sourcepub fn set_started(&self)
pub fn set_started(&self)
Sets the client as started.
Sourcepub fn set_stopped(&self)
pub fn set_stopped(&self)
Sets the client as stopped.
Sourcepub fn instruments_initialized(&self) -> bool
pub fn instruments_initialized(&self) -> bool
Returns true if instruments have been initialized.
Sourcepub fn set_instruments_initialized(&self)
pub fn set_instruments_initialized(&self)
Sets instruments as initialized.
Sourcepub const fn set_account_id(&mut self, account_id: AccountId)
pub const fn set_account_id(&mut self, account_id: AccountId)
Sets the account identifier for the execution client.