pub struct EngineRunner { /* private fields */ }Expand description
Engine runner - drives the main event loop
Implementations§
Source§impl EngineRunner
impl EngineRunner
Sourcepub fn new(engine: Engine, config: RunnerConfig) -> Self
pub fn new(engine: Engine, config: RunnerConfig) -> Self
Create an engine runner around a configured engine.
Sourcepub fn with_syncer(self, syncer_config: TradeSyncerConfig) -> Self
pub fn with_syncer(self, syncer_config: TradeSyncerConfig) -> Self
Set trade syncer configuration for upstream API syncing
Sourcepub fn set_trade_syncer(&mut self, syncer: Box<dyn TradeSync>)
pub fn set_trade_syncer(&mut self, syncer: Box<dyn TradeSync>)
Set trade syncer directly (for external configuration or testing)
Sourcepub fn with_account_syncer(self, syncer_config: AccountSyncerConfig) -> Self
pub fn with_account_syncer(self, syncer_config: AccountSyncerConfig) -> Self
Set account syncer configuration for upstream API syncing (Snapshot mechanism)
Sourcepub fn set_account_syncer(&mut self, syncer: Box<dyn AccountSync>)
pub fn set_account_syncer(&mut self, syncer: Box<dyn AccountSync>)
Set account syncer directly (for external configuration or testing)
Sourcepub fn add_exchange(&mut self, exchange: Arc<dyn Exchange>)
pub fn add_exchange(&mut self, exchange: Arc<dyn Exchange>)
Add an exchange to poll
Sourcepub fn add_instrument(&mut self, instrument: InstrumentId)
pub fn add_instrument(&mut self, instrument: InstrumentId)
Add an instrument to poll quotes for
Sourcepub fn shutdown_handle(&self) -> UnboundedSender<()>
pub fn shutdown_handle(&self) -> UnboundedSender<()>
Get shutdown sender (for external shutdown trigger)
Sourcepub fn engine(&self) -> &Engine
pub fn engine(&self) -> &Engine
Get reference to the underlying Engine. Use this after run() completes to access positions, PnL, and other state.
Sourcepub fn shutdown_reason(&self) -> Option<&str>
pub fn shutdown_reason(&self) -> Option<&str>
Get the shutdown reason if the engine was stopped by the strategy.
Sourcepub fn get_backtest_results(&self, instrument: &InstrumentId) -> BacktestResult
pub fn get_backtest_results(&self, instrument: &InstrumentId) -> BacktestResult
Compute backtest results from engine state. Call after run() completes to get summary statistics.
Auto Trait Implementations§
impl !RefUnwindSafe for EngineRunner
impl !Sync for EngineRunner
impl !UnwindSafe for EngineRunner
impl Freeze for EngineRunner
impl Send for EngineRunner
impl Unpin for EngineRunner
impl UnsafeUnpin for EngineRunner
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