Trait httptest::responders::Responder

source ·
pub trait Responder: Send {
    // Required method
    fn respond<'a>(
        &mut self,
        req: &'a Request<Bytes>
    ) -> Pin<Box<dyn Future<Output = Response<Bytes>> + Send + 'a>>;
}
Expand description

Respond with an HTTP response.

Required Methods§

source

fn respond<'a>( &mut self, req: &'a Request<Bytes> ) -> Pin<Box<dyn Future<Output = Response<Bytes>> + Send + 'a>>

Return a future that outputs an HTTP response.

Implementations on Foreign Types§

source§

impl<B> Responder for Response<B>
where B: Clone + Into<Bytes> + Send + Debug,

source§

fn respond<'a>( &mut self, _req: &'a Request<Bytes> ) -> Pin<Box<dyn Future<Output = Response<Bytes>> + Send + 'a>>

Implementors§

source§

impl Responder for Cycle

source§

impl<B> Responder for ResponseBuilder<B>
where B: Clone + Into<Bytes> + Send + Debug,

source§

impl<F, B> Responder for F
where F: FnMut() -> B + Clone + Send + 'static, B: Responder,

Respond with the response returned from the provided function.

source§

impl<R: Responder> Responder for Delay<R>