Expand description
ยงhttparse
A push library for parsing HTTP/1.x requests and responses.
The focus is on speed and safety. Unsafe code is used to keep parsing fast,
but unsafety is contained in a submodule, with invariants enforced. The
parsing internals use an Iterator
instead of direct indexing, while
skipping bounds checks.
With Rust 1.27.0 or later, support for SIMD is enabled automatically.
If building an executable to be run on multiple platforms, and thus
not passing target_feature
or target_cpu
flags to the compiler,
runtime detection can still detect SSE4.2 or AVX2 support to provide
massive wins.
If compiling for a specific target, remembering to include
-C target_cpu=native
allows the detection to become compile time checks,
making it even faster.
Modulesยง
Structsยง
- Header
- Represents a parsed header.
- Header
Parser ๐Config - Invalid
Chunk Size - An error in parsing a chunk size.
- Parser
Config - Parser configuration.
- Request
- A parsed Request.
- Response
- A parsed Response.
Enumsยง
Constantsยง
- EMPTY_
HEADER - An empty header, useful for constructing a
Header
array to pass in for parsing.
Staticsยง
- HEADER_
VALUE_ ๐MAP - TOKEN_
MAP ๐ - URI_MAP ๐
Functionsยง
- assume_
init_ ๐ โslice - deinit_
slice_ ๐ โmut - is_
header_ ๐name_ token - is_
header_ ๐value_ token - is_
method_ ๐token - Determines if byte is a method token char.
- is_
uri_ ๐token - parse_
chunk_ size - Parse a buffer of bytes as a chunk size.
- parse_
code ๐ - parse_
headers - Parse a buffer of bytes as headers.
- parse_
headers_ ๐iter - parse_
headers_ ๐iter_ uninit - parse_
reason ๐ - From RFC 7230:
- parse_
token ๐ - skip_
empty_ ๐lines - skip_
spaces ๐
Type Aliasesยง
- Result
- A Result of any parsing action.