field_names 0.1.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
#![allow(dead_code)]

use field_names::FieldNames;
#[derive(FieldNames)]
struct Example<T> {
    hello: T,
    world: String,
}

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