Crate trade_aggregation_derive
source · [−]Expand description
This crate exposes the ‘Candle’ macro, It combines multiple types that implement ‘CandleComponent’ into a single ‘ModularCandle’ struct which can then be used as the output type of some aggregation process. It also exposes getter methods for each ‘CandleComponent’ for convenience. The name of the getter method is equivalent to the field name. e.g.: struct MyCandle { open: Open, } with the derive macro will create a “fn open(&self)” method which gets the inner value
When deriving the ‘Candle’ macro, make sure the following things are in scope:
- Trade
- ModularCandle
- CandleComponent
Derive Macros
The ‘Candle’ macro takes a named struct, that has multiple fields of type ‘CandleComponent’ to automatically generate a struct that implements the ‘ModularCandle’ trait, which means it can then be used in the aggregation process. It also exposes getter functions for each ‘CandleComponent’ for convenience.