ls-qpack

Crates.iols-qpack
lib.rsls-qpack
version0.1.4
sourcesrc
created_at2022-10-16 00:23:52.908968
updated_at2023-12-20 21:27:09.548575
descriptionQPACK Field Compression for HTTP/3 (RFC 9204)
homepage
repositoryhttps://github.com/BiagioFesta/ls-qpack-rs
max_upload_size
id689232
size50,778
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