Skip to main content

HttpResponder

Trait HttpResponder 

Source
pub trait HttpResponder:
    'static
    + Send
    + Sync {
    // Required method
    fn respond<'a>(
        &'a self,
        request: &'a Request<Body>,
        response: Response<Body>,
    ) -> BoxFuture<'a, Response<Body>>;
}
Expand description

Override how a ServedRepository responds to requests. Useful for injecting failures.

Required Methods§

Source

fn respond<'a>( &'a self, request: &'a Request<Body>, response: Response<Body>, ) -> BoxFuture<'a, Response<Body>>

response is what the server would have responded with.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl HttpResponder for BlockResponseBodies

Source§

impl HttpResponder for BlockResponseBodyOnce

Source§

impl HttpResponder for BlockResponseHeaders

Source§

impl HttpResponder for Chain

Source§

impl HttpResponder for DynamicResponseCode

Source§

impl HttpResponder for FailOneThenTemporarilyBlock

Source§

impl HttpResponder for Hang

Source§

impl HttpResponder for HangBody

Source§

impl HttpResponder for NBytesThenError

Source§

impl HttpResponder for NotifyWhenRequested

Source§

impl HttpResponder for OneByteFlipped

Source§

impl HttpResponder for OneByteShortThenDisconnect

Source§

impl HttpResponder for OneByteShortThenError

Source§

impl HttpResponder for OverwriteStatusCode

Source§

impl HttpResponder for Record

Source§

impl HttpResponder for StaticResponseCode

Source§

impl<F: FilterFn, T: HttpResponder> HttpResponder for Filter<F, T>

Source§

impl<H: HttpResponder> HttpResponder for ForPath<H>

Source§

impl<H: HttpResponder> HttpResponder for ForPathPrefix<H>

Source§

impl<H: HttpResponder> HttpResponder for ForPathSuffix<H>

Source§

impl<H: HttpResponder> HttpResponder for ForPaths<H>

Source§

impl<H: HttpResponder> HttpResponder for ForRequestCount<H>

Source§

impl<H: HttpResponder> HttpResponder for Once<H>

Source§

impl<H: HttpResponder> HttpResponder for OncePerPath<H>

Source§

impl<H: HttpResponder> HttpResponder for OverrideNth<H>

Source§

impl<H: HttpResponder> HttpResponder for Toggleable<H>

Source§

impl<T: JsonTransformer> HttpResponder for T

Responder that manipulates requests with json-formatted bodies.