#struct #traits #macro-derive #proc-macro #procedural #header #tablefy

macro tablefy_derive

A procedural macro to help Tablefy any struct!

4 releases

0.2.1 Jul 29, 2019
0.2.0 Jul 29, 2019
0.1.1 Jul 26, 2019
0.1.0 Jul 25, 2019

#348 in #header

Download history 9/week @ 2023-11-23 4/week @ 2023-11-30 1/week @ 2023-12-07 7/week @ 2024-01-11 6/week @ 2024-01-18 7/week @ 2024-02-01 35/week @ 2024-02-08 61/week @ 2024-02-15 59/week @ 2024-02-22 69/week @ 2024-02-29 45/week @ 2024-03-07

237 downloads per month

MPL-2.0 license

10KB
140 lines

tablefy_derive

tablefy_derive tablefy_derive

A procedural macro to derive the Tablefy trait for any struct. (Currently with the limitation that said struct needs to have values that implement the Display trait.)

Changelog to keep track of progress

#[derive(Tablefy)]

The main derive macro! Derives the Tablefy trait for any struct satisfying the before-mentioned limitation (for now). The field names are set as the headers, with the contents being set as the rows. However, if you want to change the name of the headers, then you should use...

#[header(name = <str>)]

Put this above any field in order to customize what its header name should be. Note that <str> can be any valid string literal. If any cryptic errors arise from using this however, feel free to raise an issue.

Dependencies

~2MB
~45K SLoC