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 = HashMap<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 = HashMap<RequestHeadersKey, RequestHeadersValue>;
27/// Request new result
28pub type RequestNewResult = Result<Request, RequestError>;
29/// RwLockReadGuardRequest
30pub type RwLockReadGuardRequest<'a> = RwLockReadGuard<'a, Request>;
31/// RwLockWriteGuardRequest
32pub type RwLockWriteGuardRequest<'a> = RwLockWriteGuard<'a, Request>;
33
34/// Represents an HTTP request.
35///
36/// # Fields
37/// - `method`: The HTTP method of the request.
38/// - `host`: The host of the request.
39/// - `version`: The version of the request.
40/// - `path`: The path of the request.
41/// - `querys`: The query string of the request.
42/// - `headers`: A collection of HTTP headers as key-value pairs.
43/// - `body`: The binary body of the request.
44#[derive(Debug, Clone, Lombok, DisplayDebug)]
45pub struct Request {
46    #[set(skip)]
47    pub(super) method: RequestMethod,
48    #[set(skip)]
49    pub(super) host: RequestHost,
50    #[set(skip)]
51    pub(super) version: RequestVersion,
52    #[set(skip)]
53    pub(super) path: RequestPath,
54    pub(super) querys: RequestQuerys,
55    pub(super) headers: RequestHeaders,
56    #[set(skip)]
57    pub(super) body: RequestBody,
58}