Module rocket::response::content
[−]
[src]
Contains types that set the Content-Type of a response.
Usage
Each type wraps a given responder. The Responder
implementation of each
type replaces the Content-Type of the wrapped responder and delegates the
remainder of the response to the wrapped responder. This allows for setting
the Content-Type of a type that doesn't set it itself or for overriding one
that does.
Example
The following snippet creates an HTML
content response for a string.
Normally, raw strings set their response Content-Type to text/plain
. By
using the HTML
content response, the Content-Type will be set to
text/html
instead.
use rocket::response::content; let response = content::HTML("<h1>Hello, world!</h1>");
Structs
CSS |
Override the |
Content |
Sets the Content-Type of a |
HTML |
Override the |
JSON |
Override the |
JavaScript |
Override the |
Plain |
Override the |
XML |
Override the |