pub trait Exchange:
Send
+ Sync
+ Any {
Show 13 methods
// Required methods
fn venue(&self) -> Venue;
fn place_order<'life0, 'async_trait>(
&'life0 self,
order: Order,
report_tx: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn cancel_order<'life0, 'async_trait>(
&'life0 self,
order_id: SmartString,
report_tx: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn modify_order<'life0, 'async_trait>(
&'life0 self,
order_id: SmartString,
new_price: Option<Decimal>,
new_quantity: Option<Decimal>,
report_tx: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn cancel_all_orders<'life0, 'async_trait>(
&'life0 self,
instrument_id: Option<InstrumentId>,
report_tx: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_order_status<'life0, 'life1, 'async_trait>(
&'life0 self,
order_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<OrderStatus>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn disconnect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn is_connected<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_instruments<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<SmallVec<[InstrumentId; 32]>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn supports_batch_orders(&self) -> bool { ... }
fn place_batch_orders<'life0, 'async_trait>(
&'life0 self,
_orders: SmallVec<[Order; 8]>,
_report_tx: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<BatchResult<()>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn cancel_batch_orders<'life0, 'async_trait>(
&'life0 self,
_order_ids: SmallVec<[SmartString; 8]>,
_report_tx: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<BatchResult<()>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Interface for connecting to trading venues
Required Methods§
Sourcefn place_order<'life0, 'async_trait>(
&'life0 self,
order: Order,
report_tx: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn place_order<'life0, 'async_trait>(
&'life0 self,
order: Order,
report_tx: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Places a new order on the exchange
Sourcefn cancel_order<'life0, 'async_trait>(
&'life0 self,
order_id: SmartString,
report_tx: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn cancel_order<'life0, 'async_trait>(
&'life0 self,
order_id: SmartString,
report_tx: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Cancels an existing order
Sourcefn modify_order<'life0, 'async_trait>(
&'life0 self,
order_id: SmartString,
new_price: Option<Decimal>,
new_quantity: Option<Decimal>,
report_tx: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn modify_order<'life0, 'async_trait>(
&'life0 self,
order_id: SmartString,
new_price: Option<Decimal>,
new_quantity: Option<Decimal>,
report_tx: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Modifies an existing order
Sourcefn cancel_all_orders<'life0, 'async_trait>(
&'life0 self,
instrument_id: Option<InstrumentId>,
report_tx: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn cancel_all_orders<'life0, 'async_trait>(
&'life0 self,
instrument_id: Option<InstrumentId>,
report_tx: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Cancels all open orders, optionally filtered by instrument
Sourcefn get_order_status<'life0, 'life1, 'async_trait>(
&'life0 self,
order_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<OrderStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_order_status<'life0, 'life1, 'async_trait>(
&'life0 self,
order_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<OrderStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieves the status of an order
Sourcefn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Connects to the exchange
Sourcefn disconnect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn disconnect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Disconnects from the exchange
Sourcefn is_connected<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_connected<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Checks if connected to the exchange
Sourcefn get_instruments<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<SmallVec<[InstrumentId; 32]>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_instruments<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<SmallVec<[InstrumentId; 32]>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets a list of instruments supported by this exchange
Provided Methods§
Sourcefn supports_batch_orders(&self) -> bool
fn supports_batch_orders(&self) -> bool
Check if this exchange supports batch orders
Sourcefn place_batch_orders<'life0, 'async_trait>(
&'life0 self,
_orders: SmallVec<[Order; 8]>,
_report_tx: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<BatchResult<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn place_batch_orders<'life0, 'async_trait>(
&'life0 self,
_orders: SmallVec<[Order; 8]>,
_report_tx: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<BatchResult<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Place multiple orders in a single batch with improved error handling
Returns a BatchResult that separates transport-level errors from per-order errors.
This allows for better error handling strategies and more accurate reporting.
Sourcefn cancel_batch_orders<'life0, 'async_trait>(
&'life0 self,
_order_ids: SmallVec<[SmartString; 8]>,
_report_tx: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<BatchResult<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn cancel_batch_orders<'life0, 'async_trait>(
&'life0 self,
_order_ids: SmallVec<[SmartString; 8]>,
_report_tx: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<BatchResult<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Cancel multiple orders in a single batch with improved error handling
Returns a BatchResult that separates transport-level errors from per-order errors.
This allows for better error handling strategies and more accurate reporting.