1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
use TokenStream;
/// Dummy derive macro to get around `cfg_attr` incompatibility of several
/// of pyo3's attribute macros. See <https://github.com/PyO3/pyo3/issues/780>.
///
/// `MockPyo3` is an invented trait.
/// Dummy derive macro to enable the `dbn` helper attribute for record types
/// using the `dbn_record` proc macro but neither `CsvSerialize` nor `JsonSerialize` as
/// helper attributes aren't supported for proc macros alone. See
/// <https://github.com/rust-lang/rust/issues/65823>.
/// Derive macro for CSV serialization. Supports the following `dbn` attributes:
/// - `c_char`: serializes the field as a `char`
/// - `encode_order`: overrides the position of the field in the CSV table
/// - `fixed_price`: serializes the field as fixed-price, with the output format
/// depending on `PRETTY_PX`
/// - `skip`: does not serialize the field
/// - `unix_nanos`: serializes the field as a UNIX timestamp, with the output format
/// depending on `PRETTY_TS`
///
/// Note: fields beginning with `_` will automatically be skipped, e.g. `_reserved`
/// isn't serialized.
/// Derive macro for JSON serialization.
///
/// Supports the following `dbn` attributes:
/// - `c_char`: serializes the field as a `char`
/// - `fixed_price`: serializes the field as fixed-price, with the output format
/// depending on `PRETTY_PX`
/// - `skip`: does not serialize the field
/// - `unix_nanos`: serializes the field as a UNIX timestamp, with the output format
/// depending on `PRETTY_TS`
///
/// Note: fields beginning with `_` will automatically be skipped, e.g. `_reserved`
/// isn't serialized.
/// Derive macro for field descriptions exposed to Python.
///
/// Supports the following `dbn` attributes:
/// - `c_char`: indicates the field dtype should be a single-character string rather
/// than an integer
/// - `encode_order`: overrides the position of the field in the ordered list
/// - `fixed_price`: indicates this is a fixed-precision field
/// - `skip`: indicates this field should be hidden
/// - `unix_nanos`: indicates this is a UNIX nanosecond timestamp field
/// Attribute macro that acts like a derive macro for `Debug` (with customization),
/// `Record`, `RecordMut`, `HasRType`, `PartialOrd`, and `AsRef<[u8]>`.
///
/// Expects 1 or more paths to `u8` constants that are the RTypes associated
/// with this record.
///
/// Supports the following `dbn` attributes:
/// - `c_char`: format the type as a `char` instead of as a numeric
/// - `fixed_price`: format the integer as a fixed-precision decimal
/// - `fmt_binary`: format as a binary
/// - `fmt_method`: try to format by calling the getter method with the same name as the
/// - `index_ts`: indicates this field is the primary timestamp for the record
/// field. If the getter returns an error, the raw field value will be used
/// - `skip`: won't be included in the `Debug` output
///
/// Note: attribute macros don't support helper attributes on their own. If not deriving
/// `CsvSerialize` or `JsonSerialize`, derive `DbnAttr` to use the `dbn` helper attribute
/// without a compiler error.
/// Derive macro for Debug representations with the same extensions for DBN records
/// as `dbn_record`.
///
/// Supports the following `dbn` attributes:
/// - `c_char`: format the type as a `char` instead of as a numeric
/// - `fixed_price`: format the integer as a fixed-precision decimal
/// - `fmt_binary`: format as a binary
/// - `fmt_method`: try to format by calling the getter method with the same name as the
/// field. If the getter returns an error, the raw field value will be used
/// - `skip`: won't be included in the `Debug` output
///
/// Note: fields beginning with `_` will automatically be skipped, e.g. `_reserved`
/// isn't included in the `Debug` output.
/// Derive macro for Python-specific `__repr__` output.
///
/// Generates an implementation of `WritePyRepr` for the type.
/// Uses the `dbn` attributes.