pub trait ExecutionClient {
Show 24 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<()> { ... }
fn generate_order_status_report<'life0, 'life1, 'async_trait>(
&'life0 self,
cmd: &'life1 GenerateOrderStatusReport,
) -> Pin<Box<dyn Future<Output = Result<Option<OrderStatusReport>>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn generate_order_status_reports<'life0, 'life1, 'async_trait>(
&'life0 self,
cmd: &'life1 GenerateOrderStatusReports,
) -> Pin<Box<dyn Future<Output = Result<Vec<OrderStatusReport>>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn generate_fill_reports<'life0, 'async_trait>(
&'life0 self,
cmd: GenerateFillReports,
) -> Pin<Box<dyn Future<Output = Result<Vec<FillReport>>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn generate_position_status_reports<'life0, 'life1, 'async_trait>(
&'life0 self,
cmd: &'life1 GeneratePositionStatusReports,
) -> Pin<Box<dyn Future<Output = Result<Vec<PositionStatusReport>>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn generate_mass_status<'life0, 'async_trait>(
&'life0 self,
lookback_mins: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Option<ExecutionMassStatus>>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}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.
Sourcefn submit_order_list(&self, cmd: &SubmitOrderList) -> Result<()>
fn submit_order_list(&self, cmd: &SubmitOrderList) -> Result<()>
Sourcefn modify_order(&self, cmd: &ModifyOrder) -> Result<()>
fn modify_order(&self, cmd: &ModifyOrder) -> Result<()>
Sourcefn cancel_order(&self, cmd: &CancelOrder) -> Result<()>
fn cancel_order(&self, cmd: &CancelOrder) -> Result<()>
Sourcefn cancel_all_orders(&self, cmd: &CancelAllOrders) -> Result<()>
fn cancel_all_orders(&self, cmd: &CancelAllOrders) -> Result<()>
Sourcefn batch_cancel_orders(&self, cmd: &BatchCancelOrders) -> Result<()>
fn batch_cancel_orders(&self, cmd: &BatchCancelOrders) -> Result<()>
Sourcefn query_account(&self, cmd: &QueryAccount) -> Result<()>
fn query_account(&self, cmd: &QueryAccount) -> Result<()>
Sourcefn query_order(&self, cmd: &QueryOrder) -> Result<()>
fn query_order(&self, cmd: &QueryOrder) -> Result<()>
Sourcefn generate_order_status_report<'life0, 'life1, 'async_trait>(
&'life0 self,
cmd: &'life1 GenerateOrderStatusReport,
) -> Pin<Box<dyn Future<Output = Result<Option<OrderStatusReport>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn generate_order_status_report<'life0, 'life1, 'async_trait>(
&'life0 self,
cmd: &'life1 GenerateOrderStatusReport,
) -> Pin<Box<dyn Future<Output = Result<Option<OrderStatusReport>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn generate_order_status_reports<'life0, 'life1, 'async_trait>(
&'life0 self,
cmd: &'life1 GenerateOrderStatusReports,
) -> Pin<Box<dyn Future<Output = Result<Vec<OrderStatusReport>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn generate_order_status_reports<'life0, 'life1, 'async_trait>(
&'life0 self,
cmd: &'life1 GenerateOrderStatusReports,
) -> Pin<Box<dyn Future<Output = Result<Vec<OrderStatusReport>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn generate_fill_reports<'life0, 'async_trait>(
&'life0 self,
cmd: GenerateFillReports,
) -> Pin<Box<dyn Future<Output = Result<Vec<FillReport>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate_fill_reports<'life0, 'async_trait>(
&'life0 self,
cmd: GenerateFillReports,
) -> Pin<Box<dyn Future<Output = Result<Vec<FillReport>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generates fill reports based on execution results.
§Errors
Returns an error if fill report generation fails.