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: Rc<RefCell<Cache>>,
) -> 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: Rc<RefCell<Cache>>, ) -> 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.
Trait Implementations§
Source§impl Clone for ExecutionClientCore
impl Clone for ExecutionClientCore
Auto Trait Implementations§
impl !Freeze for ExecutionClientCore
impl !RefUnwindSafe for ExecutionClientCore
impl !Send for ExecutionClientCore
impl !Sync for ExecutionClientCore
impl Unpin for ExecutionClientCore
impl UnsafeUnpin for ExecutionClientCore
impl !UnwindSafe for ExecutionClientCore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more