[][src]Trait httptest::responders::Responder

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

Respond with an HTTP response.

Required methods

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

Return a future that outputs an HTTP response.

Loading content...

Implementations on Foreign Types

impl<B> Responder for Response<B> where
    B: Clone + Into<Body> + Send + Debug
[src]

Loading content...

Implementors

impl Responder for Cycle[src]

impl<B> Responder for ResponseBuilder<B> where
    B: Clone + Into<Body> + Send + Debug
[src]

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

Respond with the response returned from the provided function.

Loading content...