#http-3 #qpack #quic #networking #rfc-9204

sys ls-qpack-sys

QPACK (RFC 9204) Rust binding to C library ls-qpack

6 releases

0.1.4 Dec 20, 2023
0.1.3 Sep 16, 2023
0.1.2 Jun 24, 2023
0.1.1 May 26, 2023
0.1.0-alpha Oct 16, 2022

#35 in #http-3

Download history 31/week @ 2024-02-09 10/week @ 2024-02-16 43/week @ 2024-02-23 27/week @ 2024-03-01 52/week @ 2024-03-08 27/week @ 2024-03-15 11/week @ 2024-03-22 39/week @ 2024-03-29 24/week @ 2024-04-05 3072/week @ 2024-04-12 1311/week @ 2024-04-19 58/week @ 2024-04-26 17/week @ 2024-05-03 8/week @ 2024-05-10 20/week @ 2024-05-17 14/week @ 2024-05-24

63 downloads per month
Used in 3 crates (via ls-qpack)

MIT/Apache

665KB
9K SLoC

C 9K SLoC // 0.0% comments Perl 340 SLoC // 0.1% comments Shell 53 SLoC // 0.1% comments Rust 53 SLoC // 0.0% comments

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);
}

Dependencies

~0–2MB
~41K SLoC