1个不稳定版本
0.1.0 | 2022年7月24日 |
---|
#1406 在 过程宏
10,470 每月下载量
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