http_request/response/response_binary/struct.rs
1use crate::*;
2
3/// A struct representing an HTTP response.
4///
5/// This struct contains all the components of an HTTP response: the HTTP version, status code,
6/// status text, headers, and body. It is used to model and manipulate HTTP responses within the
7/// application.
8///
9/// # Fields
10/// - `http_version`: A string representing the HTTP version.
11/// - `status_code`: The HTTP status code.
12/// - `status_text`: A string containing the status text associated with the status code.
13/// - `headers`: A `HashMap<String, String>` containing the headers of the response, where each key is the header name
14/// and the value is the corresponding header value.
15/// - `body`: A `Vec<u8>` representing the body of the HTTP response, which contains the content being returned.
16#[derive(Debug, Clone)]
17pub struct HttpResponseBinary {
18 /// HTTP protocol version.
19 pub(crate) http_version: ArcRwLock<HttpVersion>,
20 /// HTTP response status code.
21 pub(crate) status_code: ResponseStatusCode,
22 /// HTTP response status text.
23 pub(crate) status_text: ArcRwLock<String>,
24 /// HTTP response headers.
25 pub(crate) headers: ArcRwLock<ResponseHeaders>,
26 /// HTTP response body content.
27 pub(crate) body: ArcRwLock<RequestBody>,
28}