#content #testing #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

#1884 in Database interfaces

Download history 98/week @ 2024-12-13 83/week @ 2024-12-20 21/week @ 2024-12-27 25/week @ 2025-01-03 71/week @ 2025-01-10 58/week @ 2025-01-17 46/week @ 2025-01-24 49/week @ 2025-01-31 82/week @ 2025-02-07 136/week @ 2025-02-14 77/week @ 2025-02-21 76/week @ 2025-02-28 67/week @ 2025-03-07 87/week @ 2025-03-14 55/week @ 2025-03-21 56/week @ 2025-03-28

276 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

~16–47MB
~775K SLoC