http_type/response/struct.rs
1use crate::*;
2
3/// Represents a parsed HTTP response.
4#[derive(Debug, Clone, PartialEq, Eq, Getter, GetterMut, Setter, DisplayDebug)]
5pub struct Response {
6 /// The HTTP version used in the response.
7 pub(super) version: ResponseVersion,
8 /// The HTTP status code.
9 #[get(type(copy))]
10 pub(super) status_code: ResponseStatusCode,
11 /// The reason phrase associated with the status code.
12 #[set(type(AsRef<str>))]
13 pub(super) reason_phrase: ResponseReasonPhrase,
14 /// The response headers as key-value pairs.
15 #[set(pub(super))]
16 pub(super) headers: ResponseHeaders,
17 /// The binary body content of the response.
18 #[set(type(AsRef<[u8]>))]
19 pub(super) body: ResponseBody,
20}