ExecutionClient

Trait ExecutionClient 

Source
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§

Source

fn is_connected(&self) -> bool

Source

fn client_id(&self) -> ClientId

Source

fn account_id(&self) -> AccountId

Source

fn venue(&self) -> Venue

Source

fn oms_type(&self) -> OmsType

Source

fn get_account(&self) -> Option<AccountAny>

Source

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.

Source

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

Starts the execution client.

§Errors

Returns an error if the client fails to start.

Source

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

Stops the execution client.

§Errors

Returns an error if the client fails to stop.

Provided Methods§

Source

fn connect<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Connects the client to the execution venue.

§Errors

Returns an error if connection fails.

Source

fn disconnect<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Disconnects the client from the execution venue.

§Errors

Returns an error if disconnection fails.

Source

fn submit_order(&self, cmd: &SubmitOrder) -> Result<()>

Submits a single order command to the execution venue.

§Errors

Returns an error if submission fails.

Source

fn submit_order_list(&self, cmd: &SubmitOrderList) -> Result<()>

Submits a list of orders to the execution venue.

§Errors

Returns an error if submission fails.

Source

fn modify_order(&self, cmd: &ModifyOrder) -> Result<()>

Modifies an existing order.

§Errors

Returns an error if modification fails.

Source

fn cancel_order(&self, cmd: &CancelOrder) -> Result<()>

Cancels a specific order.

§Errors

Returns an error if cancellation fails.

Source

fn cancel_all_orders(&self, cmd: &CancelAllOrders) -> Result<()>

Cancels all orders.

§Errors

Returns an error if cancellation fails.

Source

fn batch_cancel_orders(&self, cmd: &BatchCancelOrders) -> Result<()>

Cancels a batch of orders.

§Errors

Returns an error if batch cancellation fails.

Source

fn query_account(&self, cmd: &QueryAccount) -> Result<()>

Queries the status of an account.

§Errors

Returns an error if the query fails.

Source

fn query_order(&self, cmd: &QueryOrder) -> Result<()>

Queries the status of an order.

§Errors

Returns an error if the query fails.

Implementors§