jsam / actix-default-responder

Procedural macros for generating default ``actix_web::Responder`` implementation for a custom serialization.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Actix Default Responder

Check Commit

Procedural macros for generating default actix_web::Responder implementation for a custom serialization.

Currently supported formats are:

  • JSON
  • Bincode
  • XML

Json Response

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

XML Response

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

Bincode Response

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

About

Procedural macros for generating default ``actix_web::Responder`` implementation for a custom serialization.

License:MIT License


Languages

Language:Rust 100.0%