Skip to main content

Crate http_wire

Crate http_wire 

Source
Expand description

Serialize and parse HTTP/1.x requests and responses to/from wire format bytes.

This crate provides encoding and decoding for HTTP/1.0 and HTTP/1.1 messages.

§Implementation Details

This crate leverages the hyper library for reliable and specification-compliant HTTP serialization.

Because hyper is asynchronous, the synchronous encoding APIs provided by this crate internally create a temporary, single-threaded Tokio runtime to drive the serialization. If you are already operating within an async context, you should prefer the _async variants (e.g., WireEncodeAsync) to avoid the overhead of creating a nested runtime.

§Encoding

Use the WireEncode trait to convert HTTP messages to their wire format (synchronously):

Modules§

request
HTTP request encoding and decoding.
response
HTTP response encoding and decoding.

Structs§

Header
Represents a parsed header.

Enums§

WireError
Errors that can occur during HTTP wire format encoding.

Traits§

WireDecode
Decode HTTP messages from raw bytes.
WireEncode
Encode HTTP messages to their wire format bytes (synchronous version).
WireEncodeAsync
Encode HTTP messages to their wire format bytes (async version).