Expand description
This crate provides a zero-allocation, iterator/slice-based parser for extracting
transfer encoding types as they
appear in the Transfer-Encoding
request header. Standard
encodings
are extracted as enum values, and unknown encodings are extracted as slices for
further processing.
§Example
use uhttp_transfer_encoding::{transfer_encodings, TransferEncoding, StdTransferEncoding};
let mut encs = transfer_encodings(" gzip, custom-enc, chunked");
assert_eq!(encs.next(), Some(TransferEncoding::Std(StdTransferEncoding::Chunked)));
assert_eq!(encs.next(), Some(TransferEncoding::Other("custom-enc")));
assert_eq!(encs.next(), Some(TransferEncoding::Std(StdTransferEncoding::Gzip)));
assert_eq!(encs.next(), None);
Enums§
- Standard transfer encoding scheme, as defined by IANA.
- HTTP transfer encoding scheme.
Functions§
- Create an iterator over transfer encoding layers from the given string in the form used by the
Transfer-Encoding
header field.