Module hpack::decoder [] [src]

Exposes the struct Decoder that allows for HPACK-encoded header blocks to be decoded into a header list.

The decoder only follows HPACK rules, without performing any additional (semantic) checks on the header name/value pairs, i.e. it considers the headers as opaque octets.

Example

A simple example of using the decoder that demonstrates its API:

use hpack::Decoder;
let mut decoder = Decoder::new();

let header_list = decoder.decode(&[0x82, 0x84]).unwrap();

assert_eq!(header_list, [
    (b":method".to_vec(), b"GET".to_vec()),
    (b":path".to_vec(), b"/".to_vec()),
]);

Structs

Decoder

Decodes headers encoded using HPACK.

Enums

DecoderError

Represents all errors that can be encountered while performing the decoding of an HPACK header set.

IntegerDecodingError

Represents all errors that can be encountered while decoding an integer.

StringDecodingError

Represents all errors that can be encountered while decoding an octet string.

Type Definitions

DecoderResult

The result returned by the decode method of the Decoder.