pub enum ParserState {
WaitingRequest,
ReadingRequest,
ReadingHeaders,
ReadingBody,
ReadingChunkSize,
ReadingChunkData,
ReadingChunkTrailer,
HeadersComplete,
Error,
}Expand description
HTTP/1.1 解析器状态
Variants§
WaitingRequest
等待请求
ReadingRequest
读取请求行
ReadingHeaders
读取头部
ReadingBody
读取请求体(已知 Content-Length 字节流)
ReadingChunkSize
读取 chunked 编码的 chunk-size 行(RFC 7230 §4.1)
ReadingChunkData
读取 chunked 编码的 chunk-data 字节(含尾部 CRLF 消费)
ReadingChunkTrailer
读取 chunked 编码的 trailer-part(最后一个 0-size chunk 之后)
HeadersComplete
头部+请求体 全部读取完成(可安全返回 HttpRequest)
Error
错误
Trait Implementations§
Source§impl Clone for ParserState
impl Clone for ParserState
Source§fn clone(&self) -> ParserState
fn clone(&self) -> ParserState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ParserState
Source§impl Debug for ParserState
impl Debug for ParserState
impl Eq for ParserState
Source§impl Hash for ParserState
impl Hash for ParserState
Source§impl PartialEq for ParserState
impl PartialEq for ParserState
impl StructuralPartialEq for ParserState
Auto Trait Implementations§
impl Freeze for ParserState
impl RefUnwindSafe for ParserState
impl Send for ParserState
impl Sync for ParserState
impl Unpin for ParserState
impl UnsafeUnpin for ParserState
impl UnwindSafe for ParserState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more