[−][src]Derive Macro timescale_macros::InterpolatedData
#[derive(InterpolatedData)] { // Attributes available to this derive: #[data] }
Load the layout of a structure to be consumed by InterpolatedDataTable
This structure is useless on its own and produces no useable output. This macro
exists to provide compile-time information about the struct it marks to the
InterpolatedDataTable
macro
Arguments
This macro allows for 1 argument to be provided on either the structure itself or on the fields of the structure.
rename
allows you to set the column name as it appears in the csv file different than the name of the field in the rust structure. If applied to the structure itself, it will rename the time column's header from the defaultTime (s)
The Nitty Gritty
This macro exists because macros are not able to transverse outside of their
given token tree (easily). This macro will fill up a HashMap in memory with
the layouts of any structs marked with this macro which will be searched through
when the InterpolatedDataTable
macro generates its table at compile time.
Yes, this derive macro could be an attribute macro, but keeping it as a derive
macro allows for consistency with the other macros and stops the macro from
consuming the structure provided.