pub enum EngineEvent<MarketKind = DataKind, ExchangeKey = ExchangeIndex, AssetKey = AssetIndex, InstrumentKey = InstrumentIndex> {
Shutdown(Shutdown),
Command(Command<ExchangeKey, AssetKey, InstrumentKey>),
TradingStateUpdate(TradingState),
Account(AccountStreamEvent<ExchangeKey, AssetKey, InstrumentKey>),
Market(MarketStreamEvent<InstrumentKey, MarketKind>),
}Expand description
Default Engine event that encompasses market events, account/execution
events, and Engine commands.
Note that the Engine can be configured to process custom events.
Variants§
Shutdown(Shutdown)
Command(Command<ExchangeKey, AssetKey, InstrumentKey>)
TradingStateUpdate(TradingState)
Account(AccountStreamEvent<ExchangeKey, AssetKey, InstrumentKey>)
Market(MarketStreamEvent<InstrumentKey, MarketKind>)
Implementations§
Source§impl<MarketKind, ExchangeKey, AssetKey, InstrumentKey> EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
impl<MarketKind, ExchangeKey, AssetKey, InstrumentKey> EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
Trait Implementations§
Source§impl<MarketKind: Clone, ExchangeKey: Clone, AssetKey: Clone, InstrumentKey: Clone> Clone for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
impl<MarketKind: Clone, ExchangeKey: Clone, AssetKey: Clone, InstrumentKey: Clone> Clone for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
Source§fn clone(&self) -> EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
fn clone(&self) -> EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<MarketKind: Debug, ExchangeKey: Debug, AssetKey: Debug, InstrumentKey: Debug> Debug for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
impl<MarketKind: Debug, ExchangeKey: Debug, AssetKey: Debug, InstrumentKey: Debug> Debug for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
Source§impl<'de, MarketKind, ExchangeKey, AssetKey, InstrumentKey> Deserialize<'de> for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>where
MarketKind: Deserialize<'de>,
ExchangeKey: Deserialize<'de>,
AssetKey: Deserialize<'de>,
InstrumentKey: Deserialize<'de>,
impl<'de, MarketKind, ExchangeKey, AssetKey, InstrumentKey> Deserialize<'de> for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>where
MarketKind: Deserialize<'de>,
ExchangeKey: Deserialize<'de>,
AssetKey: Deserialize<'de>,
InstrumentKey: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<MarketKind, ExchangeKey, AssetKey, InstrumentKey> From<AccountEvent<ExchangeKey, AssetKey, InstrumentKey>> for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
impl<MarketKind, ExchangeKey, AssetKey, InstrumentKey> From<AccountEvent<ExchangeKey, AssetKey, InstrumentKey>> for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
Source§fn from(value: AccountEvent<ExchangeKey, AssetKey, InstrumentKey>) -> Self
fn from(value: AccountEvent<ExchangeKey, AssetKey, InstrumentKey>) -> Self
Converts to this type from the input type.
Source§impl<MarketKind, ExchangeKey, AssetKey, InstrumentKey> From<Command<ExchangeKey, AssetKey, InstrumentKey>> for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
impl<MarketKind, ExchangeKey, AssetKey, InstrumentKey> From<Command<ExchangeKey, AssetKey, InstrumentKey>> for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
Source§impl<MarketKind, ExchangeKey, AssetKey, InstrumentKey> From<Event<ExchangeId, AccountEvent<ExchangeKey, AssetKey, InstrumentKey>>> for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
impl<MarketKind, ExchangeKey, AssetKey, InstrumentKey> From<Event<ExchangeId, AccountEvent<ExchangeKey, AssetKey, InstrumentKey>>> for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
Source§fn from(value: AccountStreamEvent<ExchangeKey, AssetKey, InstrumentKey>) -> Self
fn from(value: AccountStreamEvent<ExchangeKey, AssetKey, InstrumentKey>) -> Self
Converts to this type from the input type.
Source§impl<MarketKind, ExchangeKey, AssetKey, InstrumentKey> From<Event<ExchangeId, MarketEvent<InstrumentKey, MarketKind>>> for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
impl<MarketKind, ExchangeKey, AssetKey, InstrumentKey> From<Event<ExchangeId, MarketEvent<InstrumentKey, MarketKind>>> for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
Source§fn from(value: MarketStreamEvent<InstrumentKey, MarketKind>) -> Self
fn from(value: MarketStreamEvent<InstrumentKey, MarketKind>) -> Self
Converts to this type from the input type.
Source§impl<MarketKind, ExchangeKey, AssetKey, InstrumentKey> From<MarketEvent<InstrumentKey, MarketKind>> for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
impl<MarketKind, ExchangeKey, AssetKey, InstrumentKey> From<MarketEvent<InstrumentKey, MarketKind>> for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
Source§fn from(value: MarketEvent<InstrumentKey, MarketKind>) -> Self
fn from(value: MarketEvent<InstrumentKey, MarketKind>) -> Self
Converts to this type from the input type.
Source§impl<MarketKind, ExchangeKey, AssetKey, InstrumentKey> From<Shutdown> for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
impl<MarketKind, ExchangeKey, AssetKey, InstrumentKey> From<Shutdown> for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
Source§impl<MarketKind, ExchangeKey, AssetKey, InstrumentKey> From<TradingState> for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
impl<MarketKind, ExchangeKey, AssetKey, InstrumentKey> From<TradingState> for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
Source§fn from(value: TradingState) -> Self
fn from(value: TradingState) -> Self
Converts to this type from the input type.
Source§impl<MarketKind: PartialEq, ExchangeKey: PartialEq, AssetKey: PartialEq, InstrumentKey: PartialEq> PartialEq for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
impl<MarketKind: PartialEq, ExchangeKey: PartialEq, AssetKey: PartialEq, InstrumentKey: PartialEq> PartialEq for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
Source§fn eq(
&self,
other: &EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>,
) -> bool
fn eq( &self, other: &EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>, ) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<Clock, InstrumentData, StrategyState, RiskState, ExecutionTxs, Strategy, Risk> Processor<EngineEvent<<InstrumentData as InstrumentDataState>::MarketEventKind>> for Engine<Clock, EngineState<InstrumentData, StrategyState, RiskState>, ExecutionTxs, Strategy, Risk>where
Clock: EngineClock + for<'a> Processor<&'a EngineEvent<InstrumentData::MarketEventKind>>,
InstrumentData: InstrumentDataState,
StrategyState: for<'a> Processor<&'a AccountEvent> + for<'a> Processor<&'a MarketEvent<InstrumentIndex, InstrumentData::MarketEventKind>>,
RiskState: for<'a> Processor<&'a AccountEvent> + for<'a> Processor<&'a MarketEvent<InstrumentIndex, InstrumentData::MarketEventKind>>,
ExecutionTxs: ExecutionTxMap<ExchangeIndex, InstrumentIndex>,
Strategy: OnTradingDisabled<Clock, EngineState<InstrumentData, StrategyState, RiskState>, ExecutionTxs, Risk> + OnDisconnectStrategy<Clock, EngineState<InstrumentData, StrategyState, RiskState>, ExecutionTxs, Risk> + AlgoStrategy<State = EngineState<InstrumentData, StrategyState, RiskState>> + ClosePositionsStrategy<State = EngineState<InstrumentData, StrategyState, RiskState>>,
Risk: RiskManager<State = EngineState<InstrumentData, StrategyState, RiskState>>,
impl<Clock, InstrumentData, StrategyState, RiskState, ExecutionTxs, Strategy, Risk> Processor<EngineEvent<<InstrumentData as InstrumentDataState>::MarketEventKind>> for Engine<Clock, EngineState<InstrumentData, StrategyState, RiskState>, ExecutionTxs, Strategy, Risk>where
Clock: EngineClock + for<'a> Processor<&'a EngineEvent<InstrumentData::MarketEventKind>>,
InstrumentData: InstrumentDataState,
StrategyState: for<'a> Processor<&'a AccountEvent> + for<'a> Processor<&'a MarketEvent<InstrumentIndex, InstrumentData::MarketEventKind>>,
RiskState: for<'a> Processor<&'a AccountEvent> + for<'a> Processor<&'a MarketEvent<InstrumentIndex, InstrumentData::MarketEventKind>>,
ExecutionTxs: ExecutionTxMap<ExchangeIndex, InstrumentIndex>,
Strategy: OnTradingDisabled<Clock, EngineState<InstrumentData, StrategyState, RiskState>, ExecutionTxs, Risk> + OnDisconnectStrategy<Clock, EngineState<InstrumentData, StrategyState, RiskState>, ExecutionTxs, Risk> + AlgoStrategy<State = EngineState<InstrumentData, StrategyState, RiskState>> + ClosePositionsStrategy<State = EngineState<InstrumentData, StrategyState, RiskState>>,
Risk: RiskManager<State = EngineState<InstrumentData, StrategyState, RiskState>>,
type Audit = EngineAudit<EngineState<InstrumentData, StrategyState, RiskState>, EngineEvent<<InstrumentData as InstrumentDataState>::MarketEventKind>, EngineOutput<<Strategy as OnTradingDisabled<Clock, EngineState<InstrumentData, StrategyState, RiskState>, ExecutionTxs, Risk>>::OnTradingDisabled, <Strategy as OnDisconnectStrategy<Clock, EngineState<InstrumentData, StrategyState, RiskState>, ExecutionTxs, Risk>>::OnDisconnect>>
fn process( &mut self, event: EngineEvent<InstrumentData::MarketEventKind>, ) -> Self::Audit
Source§impl<MarketKind, ExchangeKey, AssetKey, InstrumentKey> Serialize for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
impl<MarketKind, ExchangeKey, AssetKey, InstrumentKey> Serialize for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
Source§impl<MarketEventKind> TimeExchange for EngineEvent<MarketEventKind>
impl<MarketEventKind> TimeExchange for EngineEvent<MarketEventKind>
impl<MarketKind, ExchangeKey, AssetKey, InstrumentKey> StructuralPartialEq for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
Auto Trait Implementations§
impl<MarketKind, ExchangeKey, AssetKey, InstrumentKey> Freeze for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
impl<MarketKind, ExchangeKey, AssetKey, InstrumentKey> RefUnwindSafe for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>where
ExchangeKey: RefUnwindSafe,
InstrumentKey: RefUnwindSafe,
MarketKind: RefUnwindSafe,
AssetKey: RefUnwindSafe,
impl<MarketKind, ExchangeKey, AssetKey, InstrumentKey> Send for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
impl<MarketKind, ExchangeKey, AssetKey, InstrumentKey> Sync for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
impl<MarketKind, ExchangeKey, AssetKey, InstrumentKey> Unpin for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>
impl<MarketKind, ExchangeKey, AssetKey, InstrumentKey> UnwindSafe for EngineEvent<MarketKind, ExchangeKey, AssetKey, InstrumentKey>where
ExchangeKey: UnwindSafe,
InstrumentKey: UnwindSafe,
MarketKind: UnwindSafe,
AssetKey: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more