pub trait ExecutionClient {
Show 19 methods
// Required methods
fn is_connected(&self) -> bool;
fn client_id(&self) -> ClientId;
fn account_id(&self) -> AccountId;
fn venue(&self) -> Venue;
fn oms_type(&self) -> OmsType;
fn get_account(&self) -> Option<AccountAny>;
fn generate_account_state(
&self,
balances: Vec<AccountBalance>,
margins: Vec<MarginBalance>,
reported: bool,
ts_event: UnixNanos,
) -> Result<()>;
fn start(&mut self) -> Result<()>;
fn stop(&mut self) -> Result<()>;
// Provided methods
fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn submit_order(&self, cmd: &SubmitOrder) -> Result<()> { ... }
fn submit_order_list(&self, cmd: &SubmitOrderList) -> Result<()> { ... }
fn modify_order(&self, cmd: &ModifyOrder) -> Result<()> { ... }
fn cancel_order(&self, cmd: &CancelOrder) -> Result<()> { ... }
fn cancel_all_orders(&self, cmd: &CancelAllOrders) -> Result<()> { ... }
fn batch_cancel_orders(&self, cmd: &BatchCancelOrders) -> Result<()> { ... }
fn query_account(&self, cmd: &QueryAccount) -> Result<()> { ... }
fn query_order(&self, cmd: &QueryOrder) -> Result<()> { ... }
}Expand description
Defines the interface for an execution client managing order operations.
§Thread safety
Client instances are not intended to be sent across threads. The ?Send bound
allows implementations to hold non-Send state for any Python interop.
Required Methods§
fn is_connected(&self) -> bool
fn client_id(&self) -> ClientId
fn account_id(&self) -> AccountId
fn venue(&self) -> Venue
fn oms_type(&self) -> OmsType
fn get_account(&self) -> Option<AccountAny>
Sourcefn generate_account_state(
&self,
balances: Vec<AccountBalance>,
margins: Vec<MarginBalance>,
reported: bool,
ts_event: UnixNanos,
) -> Result<()>
fn generate_account_state( &self, balances: Vec<AccountBalance>, margins: Vec<MarginBalance>, reported: bool, ts_event: UnixNanos, ) -> Result<()>
Generates and publishes the account state event.
§Errors
Returns an error if generating the account state fails.
Provided Methods§
Sourcefn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn submit_order(&self, cmd: &SubmitOrder) -> Result<()>
fn submit_order(&self, cmd: &SubmitOrder) -> Result<()>
Submits a single order command to the execution venue.
§Errors
Returns an error if submission fails.