Trait OnDisconnectStrategy

Source
pub trait OnDisconnectStrategy<Clock, State, ExecutionTxs, Risk>
where Self: Sized,
{ type OnDisconnect; // Required method fn on_disconnect( engine: &mut Engine<Clock, State, ExecutionTxs, Self, Risk>, exchange: ExchangeId, ) -> Self::OnDisconnect; }
Expand description

Strategy interface that defines what actions an Engine should perform after an ExchangeId connection disconnects.

For example, some strategies may wish to cancel all orders, close all positions, set TradingState::Disabled, etc.

Required Associated Types§

Source

type OnDisconnect

Output of the OnDisconnectStrategy that is forwarded to the AuditStream.

For example, this could include any order requests generated.

Required Methods§

Source

fn on_disconnect( engine: &mut Engine<Clock, State, ExecutionTxs, Self, Risk>, exchange: ExchangeId, ) -> Self::OnDisconnect

Perform Engine actions after receiving an ExchangeId disconnection event.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Clock, State, ExecutionTxs, Risk> OnDisconnectStrategy<Clock, State, ExecutionTxs, Risk> for DefaultStrategy<State>