Skip to main content

http_type/request/
enum.rs

1use super::*;
2
3/// How the HTTP/1 request body is delimited on the wire.
4pub(crate) enum RequestFraming {
5    /// The declared byte count, or zero when no body is present.
6    Fixed(usize),
7    /// A chunked transfer coding with an explicit terminating chunk.
8    Chunked,
9}
10
11#[derive(Clone, Debug, Deserialize, DisplayDebug, Eq, PartialEq, Serialize)]
12pub enum RequestError {
13    /// HTTP read error with HTTP status
14    HttpRead(HttpStatus),
15    /// TCP stream connection error with HTTP status
16    GetTcpStream(HttpStatus),
17    /// TLS stream connection error with HTTP status
18    GetTlsStream(HttpStatus),
19    /// Connection read error with HTTP status
20    ReadConnection(HttpStatus),
21    /// Request was aborted with HTTP status
22    RequestAborted(HttpStatus),
23    /// TLS stream connection failed with HTTP status
24    TlsStreamConnect(HttpStatus),
25    /// Redirect functionality needs to be enabled with HTTP status
26    NeedOpenRedirect(HttpStatus),
27    /// Maximum redirect times exceeded with HTTP status
28    MaxRedirectTimes(HttpStatus),
29    /// HTTP method not supported with HTTP status
30    MethodsNotSupport(HttpStatus),
31    /// Redirect URL is invalid with HTTP status
32    RedirectInvalidUrl(HttpStatus),
33    /// Client disconnected with HTTP status
34    ClientDisconnected(HttpStatus),
35    /// Redirect URL dead loop detected with HTTP status
36    RedirectUrlDeadLoop(HttpStatus),
37    /// Client closed connection with HTTP status
38    ClientClosedConnection(HttpStatus),
39    /// Server closed connection with HTTP status
40    ServerClosedConnection(HttpStatus),
41    /// Incomplete WebSocket frame with HTTP status
42    IncompleteWebSocketFrame(HttpStatus),
43    /// Request too long with HTTP status
44    RequestTooLong(HttpStatus),
45    /// Path too long with HTTP status
46    PathTooLong(HttpStatus),
47    /// Query too long with HTTP status
48    QueryTooLong(HttpStatus),
49    /// Header line too long with HTTP status
50    HeaderLineTooLong(HttpStatus),
51    /// Too many headers with HTTP status
52    TooManyHeaders(HttpStatus),
53    /// Header key too long with HTTP status
54    HeaderKeyTooLong(HttpStatus),
55    /// Header value too long with HTTP status
56    HeaderValueTooLong(HttpStatus),
57    /// Content length too large with HTTP status
58    ContentLengthTooLarge(HttpStatus),
59    /// Invalid content length with HTTP status
60    InvalidContentLength(HttpStatus),
61    /// Invalid URL scheme with HTTP status
62    InvalidUrlScheme(HttpStatus),
63    /// Invalid URL host with HTTP status
64    InvalidUrlHost(HttpStatus),
65    /// Invalid URL port with HTTP status
66    InvalidUrlPort(HttpStatus),
67    /// Invalid URL path with HTTP status
68    InvalidUrlPath(HttpStatus),
69    /// Invalid URL query with HTTP status
70    InvalidUrlQuery(HttpStatus),
71    /// Invalid URL fragment with HTTP status
72    InvalidUrlFragment(HttpStatus),
73    /// Read timeout with HTTP status
74    ReadTimeout(HttpStatus),
75    /// Write timeout with HTTP status
76    WriteTimeout(HttpStatus),
77    /// TCP connection failed with HTTP status
78    TcpConnectionFailed(HttpStatus),
79    /// TLS handshake failed with HTTP status
80    TlsHandshakeFailed(HttpStatus),
81    /// TLS certificate invalid with HTTP status
82    TlsCertificateInvalid(HttpStatus),
83    /// WebSocket frame too large with HTTP status
84    WebSocketFrameTooLarge(HttpStatus),
85    /// WebSocket opcode unsupported with HTTP status
86    WebSocketOpcodeUnsupported(HttpStatus),
87    /// WebSocket mask missing with HTTP status
88    WebSocketMaskMissing(HttpStatus),
89    /// WebSocket payload corrupted with HTTP status
90    WebSocketPayloadCorrupted(HttpStatus),
91    /// WebSocket invalid UTF-8 with HTTP status
92    WebSocketInvalidUtf8(HttpStatus),
93    /// WebSocket invalid close code with HTTP status
94    WebSocketInvalidCloseCode(HttpStatus),
95    /// WebSocket invalid extension with HTTP status
96    WebSocketInvalidExtension(HttpStatus),
97    /// HTTP request parts insufficient with HTTP status
98    HttpRequestPartsInsufficient(HttpStatus),
99    /// TCP stream connection error with HTTP status  
100    TcpStreamConnect(HttpStatus),
101    /// TLS connector build error with HTTP status
102    TlsConnectorBuild(HttpStatus),
103    /// Invalid URL error with HTTP status
104    InvalidUrl(HttpStatus),
105    /// Configuration read error with HTTP status
106    ConfigReadError(HttpStatus),
107    /// TCP stream connection error with HTTP status
108    TcpStreamConnectString(HttpStatus),
109    /// TLS connector build error with HTTP status
110    TlsConnectorBuildString(HttpStatus),
111    /// Request error with custom message
112    Request(String),
113    /// Unknown error with HTTP status
114    Unknown(HttpStatus),
115}