Module httptest::responders
source · Expand description
Responder implementations.
Reponders determine how the server will respond.
Notable types that implement responder are
ResponseBuilder
- The
ResponseBuilder
can be constructed via thestatus_code
function, and has convenience methods to modify the response further.
- The
http::Response<String>
orhttp::Response<Vec<u8>>
- A function that returns a Responder.
- The function is allowed to make arbitrary blocking calls like std::thread::sleep or reading from a file without impacting concurrent connections to the server.
Macros§
- a Responder that cycles through a list of responses.
Structs§
- The
Cycle
responder returned by cycle() - Responder that delays the embedded response
- Convenient ResponseBuilder that implements Responder.
Traits§
- Respond with an HTTP response.
Functions§
- Cycle through the provided list of responders.
- respond with the given responder after a delay
- respond with a body that is the json encoding of data.
- respond with the provided status code and an empty body.
- respond with a body that is the url encoding of data.