uhttp_content_encoding 0.5.1

Iterator/slice-based parser for HTTP Content-Encoding header
Documentation
  • Coverage
  • 100%
    14 out of 14 items documented1 out of 5 items with examples
  • Size
  • Source code size: 9.68 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.9 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • kchmck/uhttp_content_encoding.rs
    0 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • kchmck

This crate provides a zero-allocation, iterator/slice-based parser for extracting HTTP content encoding types as they appear in the Content-Encoding request header. Standard encodings are extracted as enum values, and unknown encodings are extracted as slices for further processing.

Example

use uhttp_content_encoding::{content_encodings, ContentEncoding, StdContentEncoding};

let mut encs = content_encodings(" gzip, identity, custom-enc");
assert_eq!(encs.next(), Some(ContentEncoding::Other("custom-enc")));
assert_eq!(encs.next(), Some(ContentEncoding::Std(StdContentEncoding::Identity)));
assert_eq!(encs.next(), Some(ContentEncoding::Std(StdContentEncoding::Gzip)));
assert_eq!(encs.next(), None);