http_type/response/struct.rs
1use super::*;
2
3/// Represents a parsed HTTP response.
4///
5/// The fields stay `pub`: `type/tests/response` reads them directly, so this is
6/// published API and ยง17.14 does not recall it (semver).
7#[derive(
8 Clone, Debug, Deserialize, DisplayDebug, Eq, Getter, GetterMut, PartialEq, Serialize, Setter,
9)]
10pub struct Response {
11 /// The HTTP version used in the response.
12 pub version: ResponseVersion,
13 /// The HTTP status code.
14 #[get(type(copy))]
15 pub status_code: ResponseStatusCode,
16 /// The reason phrase associated with the status code.
17 #[set(type(AsRef<str>))]
18 pub reason_phrase: ResponseReasonPhrase,
19 /// The response headers as key-value pairs.
20 pub headers: ResponseHeaders,
21 /// The binary body content of the response.
22 #[set(type(AsRef<[u8]>))]
23 pub body: ResponseBody,
24}