#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

#1023 in Database interfaces

Download history 90/week @ 2024-10-02 140/week @ 2024-10-09 192/week @ 2024-10-16 96/week @ 2024-10-23 55/week @ 2024-10-30 48/week @ 2024-11-06 34/week @ 2024-11-13 67/week @ 2024-11-20 97/week @ 2024-11-27 57/week @ 2024-12-04 118/week @ 2024-12-11 94/week @ 2024-12-18 30/week @ 2024-12-25 22/week @ 2025-01-01 46/week @ 2025-01-08 74/week @ 2025-01-15

179 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–47MB
~770K SLoC