#content #schema #empty #rocket #okapi #responder #empty-response

rocket_empty

Provides a 204 No Content responder for Rocket. Includes optional schema definition.

3 releases

0.1.2 Oct 21, 2024
0.1.1 Jan 18, 2023
0.1.0 Jan 18, 2023

#1268 in Database interfaces

Download history 62/week @ 2024-10-29 49/week @ 2024-11-05 33/week @ 2024-11-12 58/week @ 2024-11-19 107/week @ 2024-11-26 53/week @ 2024-12-03 113/week @ 2024-12-10 104/week @ 2024-12-17 37/week @ 2024-12-24 18/week @ 2024-12-31 46/week @ 2025-01-07 76/week @ 2025-01-14 52/week @ 2025-01-21 30/week @ 2025-01-28 93/week @ 2025-02-04 114/week @ 2025-02-11

298 downloads per month
Used in rocket_authifier

MIT license

4KB

rocket_empty

rocket_empty 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_empty::EmptyResponse;

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

Dependencies

~15–46MB
~773K SLoC