http_type/request/
type.rs

1use crate::*;
2
3/// Request method
4pub type RequestMethod = Methods;
5/// Request host
6pub type RequestHost = String;
7/// Request version
8pub type RequestVersion = HttpVersion;
9/// Request path
10pub type RequestPath = String;
11/// Request querys key
12pub type RequestQuerysKey = String;
13/// Request querys value
14pub type RequestQuerysValue = String;
15/// Request querys
16pub type RequestQuerys = HashMapXxHash3_64<RequestQuerysKey, RequestQuerysValue>;
17///  Request body
18pub type RequestBody = Vec<u8>;
19///  Request body string
20pub type RequestBodyString = String;
21/// Request headers key
22pub type RequestHeadersKey = String;
23/// Request headers value
24pub type RequestHeadersValue = String;
25/// Request headers
26pub type RequestHeaders = HashMapXxHash3_64<RequestHeadersKey, RequestHeadersValue>;
27/// Request reader handle result
28pub type RequestReaderHandleResult = Result<Request, RequestError>;
29/// RwLockReadGuardRequest
30pub type RwLockReadGuardRequest<'a> = RwLockReadGuard<'a, Request>;
31/// RwLockWriteGuardRequest
32pub type RwLockWriteGuardRequest<'a> = RwLockWriteGuard<'a, Request>;
33/// OptionRequestQuerysValue
34pub type OptionRequestQuerysValue = Option<RequestQuerysValue>;
35/// OptionRequestHeadersValue
36pub type OptionRequestHeadersValue = Option<RequestHeadersValue>;
37
38/// Represents an HTTP request.
39///
40/// # Fields
41/// - `method`: The HTTP method of the request.
42/// - `host`: The host of the request.
43/// - `version`: The version of the request.
44/// - `path`: The path of the request.
45/// - `querys`: The query string of the request.
46/// - `headers`: A collection of HTTP headers as key-value pairs.
47/// - `body`: The binary body of the request.
48#[derive(Debug, Clone, Lombok, DisplayDebug)]
49pub struct Request {
50    #[set(skip)]
51    pub(super) method: RequestMethod,
52    #[set(skip)]
53    pub(super) host: RequestHost,
54    #[set(skip)]
55    pub(super) version: RequestVersion,
56    #[set(skip)]
57    pub(super) path: RequestPath,
58    pub(super) querys: RequestQuerys,
59    pub(super) headers: RequestHeaders,
60    #[set(skip)]
61    pub(super) body: RequestBody,
62}