pub trait IntoResponse<B, ResB> {
    // Required method
    fn into_response(self, body: B) -> Response<ResB>;

    // Provided method
    fn as_response(&mut self, body: B) -> Response<ResB>
       where Self: Default { ... }
}
Expand description

Helper trait for convert a Request to Response. This is for re-use request’s heap allocation and pass down the context data inside Extensions

Required Methods§

source

fn into_response(self, body: B) -> Response<ResB>

Provided Methods§

source

fn as_response(&mut self, body: B) -> Response<ResB>
where Self: Default,

Implementors§

source§

impl<ReqB, B, ResB> IntoResponse<B, ResB> for Request<ReqB>
where B: Into<ResB>,