ls-qpack-sys

Crates.iols-qpack-sys
lib.rsls-qpack-sys
version0.1.4
sourcesrc
created_at2022-10-16 00:21:30.935275
updated_at2023-12-20 21:26:24.629847
descriptionQPACK (RFC 9204) Rust binding to C library ls-qpack
homepage
repositoryhttps://github.com/BiagioFesta/ls-qpack-rs
max_upload_size
id689231
size5,696,585
Biagio Festa (BiagioFesta)

documentation

README

ls-qpack

crates.io docs.rs

QPACK: Field Compression for HTTP/3 (RFC 9204)

Rust implementation based on ls-qpack

Introduction

QPACK is a compressor for headers data used by HTTP/3. It allows correctness in the presence of out-of-order delivery, with flexibility for implementations to balance between resilience against head-of-line blocking and optimal compression ratio.

Example

use ls_qpack::decoder::Decoder;
use ls_qpack::encoder::Encoder;
use ls_qpack::StreamId;

const HEADERS: [(&str, &str); 2] = [(":status", "404"), ("foo", "bar")];

fn main() {
    let (encoded_headers, _) = Encoder::new()
        .encode_all(StreamId::new(0), HEADERS)
        .unwrap()
        .into();

    let decoded_headers = Decoder::new(0, 0)
        .decode(StreamId::new(0), encoded_headers)
        .unwrap()
        .take()
        .unwrap();

    println!("Decoded header: {:?}", decoded_headers);
}
Commit count: 17

cargo fmt