pub struct Response { /* private fields */ }Expand description
An HTTP response.
Implementations§
Source§impl Response
impl Response
Sourcepub fn new(
status: impl Into<Status>,
headers: Header,
body: impl Into<Body>,
) -> Self
pub fn new( status: impl Into<Status>, headers: Header, body: impl Into<Body>, ) -> Self
Creates a new HTTP response.
Sourcepub fn status_mut(&mut self) -> &mut Status
pub fn status_mut(&mut self) -> &mut Status
Returns a mutable reference to the response status.
Sourcepub fn headers_mut(&mut self) -> &mut Header
pub fn headers_mut(&mut self) -> &mut Header
Returns a mutable reference to the response headers.
Sourcepub fn into_parts(self) -> (Status, Header, Body)
pub fn into_parts(self) -> (Status, Header, Body)
Consumes the response and returns its components.
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 UnsafeUnpin 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