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

rocket_empty

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

3 releases

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

#897 in Database interfaces

Download history 44/week @ 2024-07-01 21/week @ 2024-07-08 41/week @ 2024-07-15 29/week @ 2024-07-22 39/week @ 2024-07-29 38/week @ 2024-08-05 30/week @ 2024-08-12 18/week @ 2024-08-19 62/week @ 2024-08-26 42/week @ 2024-09-02 64/week @ 2024-09-09 32/week @ 2024-09-16 77/week @ 2024-09-23 94/week @ 2024-09-30 123/week @ 2024-10-07 69/week @ 2024-10-14

366 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–49MB
~786K SLoC