rocket-no-content

Crates.iorocket-no-content
lib.rsrocket-no-content
version0.1.4
sourcesrc
created_at2024-09-22 10:32:36.869565
updated_at2024-09-29 15:47:30.738886
descriptionProvides a 204 No Content responder for Rocket. Includes optional schema definition.
homepage
repository
max_upload_size
id1382848
size4,985
Artur Dibrova (riktikdev)

documentation

README

rocket-no-content

rocket-no-content provides a singular struct EmptyResponse which has a Responder implementation that returns "204 No Content". In addition to this, it also implements a schema for okapi.

I got tired of copying the same struct and implementation between projects, so here it is.

Usage

use rocket-no-content::EmptyResponse;

#[openapi(tag = "Tagged")]
#[get("/test")]
pub async fn test() -> EmptyResponse {
  EmptyResponse
  // Responds with "204 No Content"
}
Commit count: 0

cargo fmt