Expand description
HttpResponder implementations
Structs§
- Atomic
Toggle - An atomic toggle switch.
- Block
Response Body Once - Responder that blocks sending response body until unblocked by a test. Panics if requested more than once.
- Block
Response Headers - Responder that blocks sending response headers and bodies until unblocked by a test.
- Blocked
Response - A response that is waiting to be sent.
- Chain
- Responder that calls each wrapped responder in order.
- Dynamic
Response Code - Responder that replies with an externally-settable HTTP status.
- Dynamic
Response Setter - An atomic HTTP status code carrier.
- Fail
OneThen Temporarily Block - Fails all requests with NOT_FOUND.
- Filter
- Responder that forwards requests to its wrapped Responder if filter returns true.
- ForPath
- Responder that overrides the given request path using the given responder.
- ForPath
Prefix - Responder that overrides all the requests that start with the given request path using the given responder.
- ForPath
Suffix - Responder that overrides all the requests that end with the given request path using the given responder.
- ForPaths
- Responder that overrides the given request paths using the given responder.
- ForRequest
Count - Responder that overrides the given request path for the given number of requests.
- Hang
- Responder that never sends bytes.
- Hang
Body - Responder that sends the header but then never sends body bytes.
- History
- The request history recorded by Record.
- History
Entry - Information saved by Record for each request it handles.
- NBytes
Then Error - Responder that yields the response up to the Nth byte, then produces an error. Panics if the response does not contain more than N bytes.
- Notify
When Requested - Responder that notifies a channel when it receives a request.
- Once
- Responder that forwards to its wrapped responder once.
- Once
PerPath - Responder that passes responses through the given responder once per unique path.
- OneByte
Flipped - Responder that flips the first byte of the response. Panics if the response contains an empty body.
- OneByte
Short Then Disconnect - Responder that yields the response up to the final byte, then disconnects. Panics if the response contains an empty body.
- OneByte
Short Then Error - Responder that yields the response up to the final byte, then produces an error. Panics if the response contains an empty body.
- Override
Nth - Responder that forwards to its wrapped responder the nth time it is called.
- Overwrite
Status Code - Responder that changes the status code to a given value.
- Record
- Responder that records the requests.
- Static
Response Code - Responder that always responds with the given status code
- Toggleable
- Responder that overrides requests with the given responder only when enabled
Traits§
- Filter
Fn - Used by the Filter HttpResponder to decide which requests to forward and which to ignore.
- Json
Transformer - Transform a
serde_json::Value. ImplementsHttpResponderby assuming theResponse<Body>is json-formatted. - Request
Ext - hyper::Request extension trait that makes writing
HttpResponders more convienent.
Functions§
- is_
range_ request - Returns true iff the request has a Content-Range header.