Derive Macro JsonSerialize

Source
#[derive(JsonSerialize)]
{
    // Attributes available to this derive:
    #[dbn]
}
Expand description

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.