field_names 0.2.0

A proc-macro for exposing a struct's field names at runtime.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![allow(dead_code)]

use field_names::FieldNames;

#[derive(FieldNames)]
struct Example {
    hello: String,
    world: String,
    minutes_to_midnight: u32,
    #[field_names(skip)]
    hidden: (),
}

fn main() {
    println!("{:?}", Example::FIELDS);
}