Expand description

rocket-response - Provides enum for variable Rocket Responses

This crate provides 3 enums to be flexible in returning Responses.

  1. RocketResponse provides all non-generic Response types.
  2. RocketResponseGeneric provides Response-types non-generic and generic using a single generic type.
  3. RocketResponseGeneric2 allows a different Flash type.

If you miss any Response, you are welcome to open an issue or even better provide a pull-request!

Because it is difficult to decide on the generics what might be useful, your usecases are really welcome in an issue.

Usage

For usage add the crate to your dependencies

[dependencies]
rocket-response = { version = "0.0.1-rc.2" }

Features

You can depend on a couple of features, which provide additional types.

  • json
  • msgpack
  • templates-handlebars or templates-tera
[dependencies]
rocket-response = { version = "0.0.1-rc.2", features = ["json", "templates-tera"] }

Enums

The non-generic Responses.

The non-generic and generic Responses with a single type.

The non-generic and generic Responses with 2 types.