uhttp_content_encoding 0.5.1

Iterator/slice-based parser for HTTP Content-Encoding header
Documentation

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