Crate uhttp_transfer_encoding [] [src]

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

StdTransferEncoding

Standard transfer encoding scheme, as defined by IANA.

TransferEncoding

HTTP transfer encoding scheme.

Functions

transfer_encodings

Create an iterator over transfer encoding layers from the given string in the form used by the Transfer-Encoding header field.