Skip to main content

Module middleware

Module middleware 

Source
Expand description

The request and response halves of the specification, expressed as plain functions: body decoding and content negotiation (section 2.1), entity tags (section 7) and problem details (section 5).

crate::app::LinoApp is built from these helpers, and any other HTTP stack can be wired to the same behaviour by calling them directly.

Structs§

DecodedBody
A decoded request body, together with the media type it arrived in.
EtagPolicy
How a response should treat entity tags and conditional requests.
ResponseParts
A response ready to be written to the wire.

Constants§

DEFAULT_MAX_BODY_BYTES
Largest request body accepted by default, in bytes.

Functions§

append_vary
Add a field name to Vary without repeating it.
build_problem_response
Render an error as problem details (specification section 5).
build_response
Encode a value as the negotiated representation.
decode_request_body
Decode a request body according to its Content-Type.
negotiate_request
Select the representation to produce for a request.