pub struct Response { /* private fields */ }Implementations§
Source§impl Response
impl Response
pub fn build() -> ResponseBuilder
pub fn new(body: HttpBody<ResponseBody>) -> Self
pub fn from_parts(parts: Parts, body: HttpBody<ResponseBody>) -> Self
Sourcepub fn map(self, map: impl FnOnce(HttpBody<ResponseBody>) -> BoxBody) -> Self
pub fn map(self, map: impl FnOnce(HttpBody<ResponseBody>) -> BoxBody) -> Self
Consumes the response returning a new response with body mapped to the
return type of the provided closure map.
Returns a reference to the response cookies.
Returns a mutable reference to the response cookies.
pub fn headers(&self) -> &HeaderMap
pub fn headers_mut(&mut self) -> &mut HeaderMap
pub fn status(&self) -> StatusCode
pub fn status_mut(&mut self) -> &mut StatusCode
pub fn version(&self) -> Version
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Response
impl !RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl !UnwindSafe for Response
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more