zero4rs 2.0.0

zero4rs is a powerful, pragmatic, and extremely fast web framework for Rust
Documentation
// let ctx = map!(
//     "id", 123,
//     "name", "Alice",
//     "active", true,
//     "info", map!(
//         "email", "alice@example.com",
//         "age", 28,
//         "address", map!(
//             "city", "Shanghai",
//             "zip", "200000"
//         )
//     ),
//     "tags", vec!["vip", "beta_user"]
// );

// println!("{}", serde_json::to_string_pretty(&ctx).unwrap());

/// 支持嵌套 map! 的宏
#[macro_export]
macro_rules! map {
    // 基本形式:key, value, key, value, ...
    ($($key:expr, $val:expr),* $(,)?) => {{
        let mut m = std::collections::HashMap::<String, serde_json::Value>::new();

        $(
            m.insert($key.to_string(), serde_json::json!($val));
        )*

        m
    }};

    // 支持 key = value 的形式(静态键)
    ($($key:ident = $val:expr),* $(,)?) => {{
        let mut m = std::collections::HashMap::<String, serde_json::Value>::new();

        $(
            m.insert(stringify!($key).to_string(), serde_json::json!($val));
        )*

        m
    }};
}