Crate rocket_json_response

Source
Expand description

§JSON Response for Rocket Framework

This is a crate which provides JSONResponse and JSONResponseWithoutData structs to response JSON format data with an additional code integer value.

Typically, the code 0 means OK. You can define other codes by yourself by implementing JSONResponseCode trait for your struct.

See examples.

Re-exports§

pub extern crate json_gettext;

Macros§

serialize_to_json

Structs§

JSONResponse
To respond JSON data.
JSONResponseWithoutData
To respond JSON data.

Traits§

JSONResponseCode
The code of your JSON response.
ToJSON
A data type that can be converted to a JSON-format string.