Module rustful::response [] [src]

Response writers.

The response writers are the output channel from the handlers to the client. These are used to set the response headers, as well as writing the response body. Rustful provides three different types of response writers with different purposes:

You will always start out with a Response, where you can set the status code and all the headers, and then transform it into one of the other types, if necessary. It is usually recommended to stick to Response as much as possible, since it has lower HTTP overhead than Chunked and has a builtin size check that guarantees that the content-length field is correct.

No extra overhead Guaranteed correct content-length Streaming
Response
Raw
Chunked

Structs

Chunked

An interface for writing a chunked response body.

Raw

A streaming fixed-size response.

Response

An interface for sending data to the client.

Enums

Data

A unified representation of response data.

Error

The result of a response action.

FileError

Error that may occure while sending a file.

Traits

ResponseError

Helper trait for dealing with errors that may occur while sending a response. It provides a default method of handling the error.

SendResponse

A trait for higher level types that can be sent as responses, like Result.