pub struct NoOpExchange { /* private fields */ }Expand description
Minimal exchange that does nothing - used internally by PaperExchange::new_standalone() All quotes come from queue_quotes/inject_quote, not from this exchange.
Implementations§
Source§impl NoOpExchange
impl NoOpExchange
Sourcepub fn with_exchange_id(id: &str) -> Self
pub fn with_exchange_id(id: &str) -> Self
Create with a custom exchange ID (for backtest mode matching production exchange)
Sourcepub fn with_config(id: &str, environment: Environment) -> Self
pub fn with_config(id: &str, environment: Environment) -> Self
Create with custom exchange ID and environment (for full compatibility)
Trait Implementations§
Source§impl Default for NoOpExchange
impl Default for NoOpExchange
Source§impl Exchange for NoOpExchange
impl Exchange for NoOpExchange
Source§fn exchange_id(&self) -> &ExchangeId
fn exchange_id(&self) -> &ExchangeId
Get the exchange ID
Source§fn environment(&self) -> Environment
fn environment(&self) -> Environment
Get the environment (mainnet/testnet)
Source§fn place_orders<'life0, 'life1, 'async_trait>(
&'life0 self,
_orders: &'life1 [OrderInput],
) -> Pin<Box<dyn Future<Output = Result<Vec<PlaceOrderResult>, ExchangeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn place_orders<'life0, 'life1, 'async_trait>(
&'life0 self,
_orders: &'life1 [OrderInput],
) -> Pin<Box<dyn Future<Output = Result<Vec<PlaceOrderResult>, ExchangeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Place multiple limit orders in a single batch API call.
Returns a Vec of results, one for each order in the same order as the input.
Source§fn cancel_order<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
_instrument: &'life1 InstrumentId,
_market_index: &'life2 MarketIndex,
_client_id: &'life3 ClientOrderId,
_exchange_order_id: Option<&'life4 ExchangeOrderId>,
) -> Pin<Box<dyn Future<Output = Result<(), ExchangeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn cancel_order<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
_instrument: &'life1 InstrumentId,
_market_index: &'life2 MarketIndex,
_client_id: &'life3 ClientOrderId,
_exchange_order_id: Option<&'life4 ExchangeOrderId>,
) -> Pin<Box<dyn Future<Output = Result<(), ExchangeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Cancel an order by client_id or exchange_order_id.
Source§fn cancel_all_orders<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_instrument: &'life1 InstrumentId,
_market_index: &'life2 MarketIndex,
) -> Pin<Box<dyn Future<Output = Result<u32, ExchangeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn cancel_all_orders<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_instrument: &'life1 InstrumentId,
_market_index: &'life2 MarketIndex,
) -> Pin<Box<dyn Future<Output = Result<u32, ExchangeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Cancel all orders for an instrument.
Returns number of orders canceled.
Source§fn poll_user_fills<'life0, 'life1, 'async_trait>(
&'life0 self,
_cursor: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Fill>, ExchangeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn poll_user_fills<'life0, 'life1, 'async_trait>(
&'life0 self,
_cursor: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Fill>, ExchangeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Poll user fills since cursor.
This is the primary execution event source.
cursor is opaque string (implementation-specific).
Source§fn poll_quotes<'life0, 'life1, 'async_trait>(
&'life0 self,
_instruments: &'life1 [InstrumentId],
) -> Pin<Box<dyn Future<Output = Result<Vec<Quote>, ExchangeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn poll_quotes<'life0, 'life1, 'async_trait>(
&'life0 self,
_instruments: &'life1 [InstrumentId],
) -> Pin<Box<dyn Future<Output = Result<Vec<Quote>, ExchangeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Poll current quotes/prices.
Source§fn poll_account_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<AccountState, ExchangeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn poll_account_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<AccountState, ExchangeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Poll account state (absolute).
Used for snapshot-based synchronization.
Source§fn instance(&self) -> ExchangeInstance
fn instance(&self) -> ExchangeInstance
Get the exchange instance key
Source§fn init<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ExchangeError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn init<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ExchangeError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Initialize the exchange connection and perform startup validations.
Called by the runner before entering the main loop.
Implementations can validate: connectivity, vault ownership, account balance, etc.
Auto Trait Implementations§
impl Freeze for NoOpExchange
impl RefUnwindSafe for NoOpExchange
impl Send for NoOpExchange
impl Sync for NoOpExchange
impl Unpin for NoOpExchange
impl UnsafeUnpin for NoOpExchange
impl UnwindSafe for NoOpExchange
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
Mutably borrows from an owned value. Read more