pub fn message_body<B>(&mut self, body: B) -> Result<HttpResponse<B>, Error> {
        if let Some(err) = self.err.take() {
            return Err(err.into());
        }

        let res = self
            .res
            .take()
            .expect("cannot reuse response builder")
            .set_body(body);

        #[allow(unused_mut)]
        let mut res = HttpResponse::from(res);

        #[cfg(feature = "cookies")]
        if let Some(ref jar) = self.cookies {
            for cookie in jar.delta() {
                match HeaderValue::from_str(&cookie.to_string()) {
                    Ok(val) => res.headers_mut().append(header::SET_COOKIE, val),
                    Err(err) => return Err(err.into()),
                };
            }
        }

        Ok(res)
    }
/// Set a body and generate `Response`.
///
/// `HttpResponseBuilder` can not be used after this call.
Set a body and generate `Response`.
`HttpResponseBuilder` can not be used after this call.
Set a body and generate ` Response ` . ` HttpResponseBuilder ` can not be used after this call .
pub fn message_body<B>(&mut self, body: B) -> Result<HttpResponse<B>, Error> {
        if let Some(err) = self.err.take() {
            return Err(err.into());
        }
        let res = self
            .res
            .take()
            .expect("cannot reuse response builder")
            .set_body(body);
        #[allow(unused_mut)]
        let mut res = HttpResponse::from(res);
        #[cfg(feature = "cookies")]
        if let Some(ref jar) = self.cookies {
            for cookie in jar.delta() {
                match HeaderValue::from_str(&cookie.to_string()) {
                    Ok(val) => res.headers_mut().append(header::SET_COOKIE, val),
                    Err(err) => return Err(err.into()),
                };
            }
        }
        Ok(res)
    }
pub fn message_body < B > ( & mut self , body : B ) -> Result < HttpResponse < B > , Error > { if let Some ( err ) = self . err . take ( ) { return Err ( err . into ( ) ) ; } let res = self . res . take ( ) . expect ( " " ) . set_body ( body ) ; # [ allow ( unused_mut ) ] let mut res = HttpResponse :: from ( res ) ; # [ cfg ( feature " " ) ] if let Some ( ref jar ) = self . cookies { for cookie in jar . delta ( ) { match HeaderValue :: from_str ( & cookie . to_string ( ) ) { Ok ( val ) => res . headers_mut ( ) . append ( header :: SET_COOKIE , val ) , Err ( err ) => return Err ( err . into ( ) ) , } ; } } Ok ( res ) }
Set a body and generate `Response`.
Set a body and generate ` Response ` .
&mut self
body
B
&mut self
body
B