#json-xml #xml #actix-web #json #proc-macro #actix

actix-default-responder

为特定数据类型(例如json、xml等)生成默认 Responder 实现的过程宏。

1个不稳定版本

0.1.0 2022年7月24日

#1406过程宏

Download history 2526/week @ 2024-03-14 2124/week @ 2024-03-21 993/week @ 2024-03-28 2030/week @ 2024-04-04 1722/week @ 2024-04-11 2833/week @ 2024-04-18 2504/week @ 2024-04-25 2500/week @ 2024-05-02 4702/week @ 2024-05-09 2361/week @ 2024-05-16 2773/week @ 2024-05-23 1438/week @ 2024-05-30 2497/week @ 2024-06-06 2455/week @ 2024-06-13 3056/week @ 2024-06-20 2333/week @ 2024-06-27

10,470 每月下载量

MIT/Apache

6KB
63

Actix Default Responder

用于生成自定义序列化默认 actix_web::Responder 实现的过程宏。

目前支持的格式包括

1. JSON

2. Bincode

3. XML

JSON响应

#[derive(Serialize, PartialEq, JsonResponder)]
struct JsonResponse {
    name: String,
}

XML响应

#[derive(Debug, Serialize, PartialEq, XMLResponder)]
struct XMLResponse {
    name: String,
}

Bincode响应

#[derive(Debug, Serialize, PartialEq, BincodeResponder)]
struct BincodeResponse {
    name: String,
}

依赖项

~1.5MB
~35K SLoC