orz 1.0.0

A procedural macro for generating field information methods for structs.
Documentation
// examples/demo.rs
use orz::Orz;

fn format_count(n: &i32) -> String {
    format!("{} items", n)
}

fn format_price(p: &f64) -> String {
    format!("¥{:.2}", p)
}

#[derive(Orz, Debug)]
struct Product {
    #[name("商品名称")]  // 使用 #[name("值")] 格式
    name: String,

    #[name("价格")]
    #[to_string_with("format_price")]  // 使用 #[to_string_with("函数名")] 格式
    price: f64,

    #[name("库存数量")]
    #[to_string_with("format_count")]
    stock: i32,

    #[skip]
    secret_info: String,

    // #[name("商品描述")]
    description: String,

    #[name("调试信息")]
    #[debug]
    debug_data: Vec<String>,
}

fn main() {
    let product = Product {
        name: "笔记本电脑".to_string(),
        price: 5999.99,
        stock: 100,
        secret_info: "机密信息".to_string(),
        description: "高性能游戏本".to_string(),
        debug_data: vec!["data1".to_string(), "data2".to_string()],
    };

    println!("=== 产品信息 ===");
    println!("字段名称: {:?}", Product::field_names());
    println!("字段值: {:?}", product.field_values());
    println!("字段数量: {}", Product::field_count());
    println!();

    println!("=== 字段详情 ===");
    for (name, value) in product.field_info() {
        println!("{}: {}", name, value);
    }
}