30 :
name(std::move(n)),
value(std::move(v)) {}
32 auto size() const ->
size_t
57 static auto get(
size_t index) -> std::optional<http_header>;
65 static auto find(std::string_view name, std::string_view value =
"")
72 static constexpr auto size() ->
size_t {
return 61; }
97 auto insert(std::string_view name, std::string_view value) -> void;
104 auto get(
size_t index)
const -> std::optional<http_header>;
112 auto find(std::string_view name, std::string_view value =
"")
const
113 -> std::optional<size_t>;
142 auto clear() -> void;
172 auto encode(
const std::vector<http_header>&
headers) -> std::vector<uint8_t>;
187 auto encode_integer(uint64_t value, uint8_t prefix_bits) -> std::vector<uint8_t>;
191 -> std::vector<uint8_t>;
193 -> std::vector<uint8_t>;
195 -> std::vector<uint8_t>;
197 -> std::vector<uint8_t>;
258 auto encode(std::string_view input) -> std::vector<uint8_t>;
HPACK dynamic table for header compression.
auto entry_count() const -> size_t
Get number of entries.
auto max_size() const -> size_t
Get maximum table size.
auto clear() -> void
Clear all entries.
std::deque< http_header > entries_
auto set_max_size(size_t size) -> void
Set maximum table size.
auto evict_to_size(size_t target_size) -> void
auto get(size_t index) const -> std::optional< http_header >
Get header by dynamic table index.
auto find(std::string_view name, std::string_view value="") const -> std::optional< size_t >
Find header in dynamic table.
auto insert(std::string_view name, std::string_view value) -> void
Insert header at beginning of table.
auto current_size() const -> size_t
Get current table size.
dynamic_table(size_t max_size=4096)
Construct dynamic table with max size.
HPACK header decoder (RFC 7541)
auto decode(std::span< const uint8_t > data) -> Result< std::vector< http_header > >
Decode HPACK binary to headers.
auto decode_string(std::span< const uint8_t > &data) -> Result< std::string >
auto set_max_table_size(size_t size) -> void
Set maximum dynamic table size.
auto table_size() const -> size_t
Get current dynamic table size.
auto decode_integer(std::span< const uint8_t > &data, uint8_t prefix_bits) -> Result< uint64_t >
auto get_indexed_header(size_t index) const -> Result< http_header >
hpack_decoder(size_t max_table_size=4096)
Construct decoder with max table size.
HPACK header encoder (RFC 7541)
auto encode_literal_with_indexing(std::string_view name, std::string_view value) -> std::vector< uint8_t >
auto set_max_table_size(size_t size) -> void
Set maximum dynamic table size.
auto encode(const std::vector< http_header > &headers) -> std::vector< uint8_t >
Encode headers to HPACK binary format.
hpack_encoder(size_t max_table_size=4096)
Construct encoder with max table size.
auto table_size() const -> size_t
Get current dynamic table size.
auto encode_indexed(size_t index) -> std::vector< uint8_t >
auto encode_literal_without_indexing(std::string_view name, std::string_view value) -> std::vector< uint8_t >
auto encode_integer(uint64_t value, uint8_t prefix_bits) -> std::vector< uint8_t >
auto encode_string(std::string_view str, bool huffman=false) -> std::vector< uint8_t >
HPACK static table (RFC 7541 Appendix A)
static constexpr auto size() -> size_t
Get static table size.
static auto get(size_t index) -> std::optional< http_header >
Get static table entry by index.
static auto find(std::string_view name, std::string_view value="") -> size_t
Find index of header in static table.
Huffman coding for HPACK string compression.
auto decode(std::span< const uint8_t > data) -> Result< std::string >
Decode Huffman encoded string.
auto encode(std::string_view input) -> std::vector< uint8_t >
Encode string using Huffman coding.
auto encoded_size(std::string_view input) -> size_t
Get encoded size for string.
Network-specific error and result type definitions.