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
Source§impl Response
impl Response
pub fn get_version(&self) -> &Cow<'static, str>
pub fn set_version(&mut self, val: Cow<'static, str>) -> &mut Self
pub fn get_status_code(&self) -> &usize
pub fn set_status_code(&mut self, val: usize) -> &mut Self
pub fn get_reason_phrase(&self) -> &Cow<'static, str>
pub fn set_reason_phrase(&mut self, val: Cow<'static, str>) -> &mut Self
pub fn get_headers(&self) -> &HashMap<Cow<'static, str>, Cow<'static, str>>
pub fn set_headers( &mut self, val: HashMap<Cow<'static, str>, Cow<'static, str>>, ) -> &mut Self
pub fn get_body(&self) -> &Vec<u8>
pub fn set_body(&mut self, val: Vec<u8>) -> &mut Self
pub fn get_response(&self) -> &Vec<u8>
pub fn set_response(&mut self, val: Vec<u8>) -> &mut Self
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