Response #
This module provides the Response type, which represents an HTTP response. It also defines
builder functions for constructing responses and selecting common HTTP status codes.
HTTP response structure parameterized by body type.
- line : Head
The response status-line information.
- body : t
The content of the response.
- extensions : Extensions
Optional dynamic metadata attached to the response.
Instances For
Instances For
Builds an HTTP Response.
- line : Head
The response status-line information.
- extensions : Extensions
Optional dynamic metadata attached to the response.
Instances For
Creates a new HTTP Response builder with default head (status: 200 OK, version: HTTP/1.1).
Instances For
Creates a new HTTP Response builder with default head (status: 200 OK, version: HTTP/1.1).
Instances For
Sets the HTTP status code for the response being built.
Instances For
Sets the headers for the response being built.
Instances For
Adds a single header to the response being built.
Instances For
Adds a single header to the response being built, panics if the header is invalid.
Instances For
Builds and returns the final HTTP Response with the specified body.
Instances For
Builds and returns the final HTTP Response with an empty body ({}).
Requires an EmptyCollection instance for the response body type.
Instances For
Creates a new HTTP Response builder with the 200 status code.
Instances For
Creates a new HTTP Response builder with the provided status.
Instances For
Creates a new HTTP Response builder with the 404 status code.
Instances For
Creates a new HTTP Response builder with the 500 status code.
Instances For
Creates a new HTTP Response builder with the 400 status code.
Instances For
Creates a new HTTP Response builder with the 201 status code.
Instances For
Creates a new HTTP Response builder with the 202 status code.
Instances For
Creates a new HTTP Response builder with the 401 status code.
Creates a new HTTP Response builder with the 403 status code.
Instances For
Creates a new HTTP Response builder with the 409 status code.