Crate httparse [] [src]

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.

The speed is comparable to the fast picohttpparser, currently being around 1.6 times slower than pico. Improvements can be made as a likely intrinsic, and simd, are stabilized in rustc.

Structs

Header

Represents a parsed header.

Request

A parsed Request.

Response

A parsed Response.

Enums

Error

An error in parsing.

Status

The result of a successful parse pass.

Constants

EMPTY_HEADER

An empty header, useful for constructing a Header array to pass in for parsing.

Functions

parse_headers

Parse a buffer of bytes as headers.

Type Definitions

Result

A Result of any parsing action.