Module responder

Module responder 

Source
Expand description

HttpResponder implementations

Structs§

AtomicToggle
An atomic toggle switch.
BlockResponseBodyOnce
Responder that blocks sending response body until unblocked by a test. Panics if requested more than once.
BlockResponseHeaders
Responder that blocks sending response headers and bodies until unblocked by a test.
BlockedResponse
A response that is waiting to be sent.
Chain
Responder that calls each wrapped responder in order.
DynamicResponseCode
Responder that replies with an externally-settable HTTP status.
DynamicResponseSetter
An atomic HTTP status code carrier.
FailOneThenTemporarilyBlock
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.
ForPathPrefix
Responder that overrides all the requests that start with the given request path using the given responder.
ForPathSuffix
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.
ForRequestCount
Responder that overrides the given request path for the given number of requests.
Hang
Responder that never sends bytes.
HangBody
Responder that sends the header but then never sends body bytes.
History
The request history recorded by Record.
HistoryEntry
Information saved by Record for each request it handles.
NBytesThenError
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.
NotifyWhenRequested
Responder that notifies a channel when it receives a request.
Once
Responder that forwards to its wrapped responder once.
OncePerPath
Responder that passes responses through the given responder once per unique path.
OneByteFlipped
Responder that flips the first byte of the response. Panics if the response contains an empty body.
OneByteShortThenDisconnect
Responder that yields the response up to the final byte, then disconnects. Panics if the response contains an empty body.
OneByteShortThenError
Responder that yields the response up to the final byte, then produces an error. Panics if the response contains an empty body.
OverrideNth
Responder that forwards to its wrapped responder the nth time it is called.
OverwriteStatusCode
Responder that changes the status code to a given value.
Record
Responder that records the requests.
StaticResponseCode
Responder that always responds with the given status code
Toggleable
Responder that overrides requests with the given responder only when enabled

Traits§

FilterFn
Used by the Filter HttpResponder to decide which requests to forward and which to ignore.
JsonTransformer
Transform a serde_json::Value. Implements HttpResponder by assuming the Response<Body> is json-formatted.
RequestExt
hyper::Request extension trait that makes writing HttpResponders more convienent.

Functions§

is_range_request
Returns true iff the request has a Content-Range header.