pub struct Response { /* private fields */ }Expand description
Represents an HTTP response.
§Fields
version: The HTTP version of the response (e.g., HTTP/1.1).status_code: The status code of the response (e.g., 200, 404).reason_phrase: The reason phrase corresponding to the status code (e.g., OK, Not Found).headers: A collection of HTTP headers as key-value pairs.body: The binary body of the response.response: The serialized HTTP response including headers and body.
Implementations§
Source§impl Response
impl Response
Sourcepub fn status_code(&mut self, code: usize) -> &mut Response
pub fn status_code(&mut self, code: usize) -> &mut Response
Sourcepub fn reason_phrase<S>(&mut self, phrase: S) -> &mut Response
pub fn reason_phrase<S>(&mut self, phrase: S) -> &mut Response
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