http_type/response/
type.rs1use super::error::Error as ResponseError;
2use crate::*;
3
4pub type ResponseData = Vec<u8>;
6
7pub type ResponseBody = Vec<u8>;
9
10pub type ResponseHeadersKey = String;
12
13pub type ResponseHeadersValue = String;
15
16pub type ResponseHeaders = HashMap<ResponseHeadersKey, ResponseHeadersValue>;
18
19pub type ResponseVersion = String;
21
22pub type ResponseStatusCode = usize;
24
25pub type ResponseReasonPhrase = String;
27
28pub type ResponseResult = Result<(), ResponseError>;
30
31pub type CloseStreamResult = Result<(), ResponseError>;
33
34#[derive(Debug, Clone, Lombok, PartialEq, Eq)]
44pub struct Response {
45 #[set(skip)]
46 pub(super) version: ResponseVersion,
47 pub(super) status_code: ResponseStatusCode,
48 #[set(skip)]
49 pub(super) reason_phrase: ResponseReasonPhrase,
50 pub(super) headers: ResponseHeaders,
51 #[set(skip)]
52 pub(super) body: ResponseBody,
53 #[set(super)]
54 pub(super) response: ResponseData,
55}