Skip to main content

Module strategy

Module strategy 

Source
Expand description

Strategy trait and engine context.

A strategy is a deterministic state machine. It receives Event values, reads current engine state through StrategyContext, and emits commands through that same context.

§Lifecycle

on_start -> on_event / on_timer ... -> on_stop

Strategies should keep exchange I/O out of their implementation. Direct HTTP calls belong in exchange adapters.

Structs§

TimerHandle
Timer registration result.

Traits§

Strategy
The Strategy trait - what every strategy must implement.
StrategyContext
Strategy context - what strategies use to interact with the engine.