Crates.io | jder_axum |
lib.rs | jder_axum |
version | |
source | src |
created_at | 2024-10-04 19:07:51.224552+00 |
updated_at | 2025-01-09 12:24:06.101136+00 |
description | A response builder for axum |
homepage | https://github.com/alpheustangs/jder_axum |
repository | https://github.com/alpheustangs/jder_axum |
max_upload_size | |
id | 1396987 |
Cargo.toml error: | TOML parse error at line 23, column 1 | 23 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
A response builder for axum.
This package includes several axum response builders and different extractors based on the JSON response structure specified in JSON Data Error Response (JDER). With the builders and extractors provided, various kinds of responses can be created easily instead of sending plain text responses.
Create a JSON response for an axum route:
use jder_axum::response::{
Response,
json::CreateJsonResponse,
};
async fn route() -> Response {
CreateJsonResponse::dataless().send()
}
And the response will be shown as below:
{
"success": true,
"data": null,
"error": null
}
This project is licensed under the terms of the MIT license.