Module params
Available on crate feature
fastcgi only.Expand description
FastCGI name-value pair encoding used in PARAMS and GET_VALUES records.
Each name-value pair is encoded with a variable-length prefix for both the name length and the value length:
- If the length fits in 7 bits (0–127), it is stored as a single byte with the high bit clear.
- Otherwise the length occupies 4 bytes, with the high bit of the first byte set and the remaining 31 bits carrying the length value.
Reference: FastCGI Specification §3.4
Structs§
- NvPair
- A single FastCGI name-value pair (owned).
- NvPair
Ref - A borrowed FastCGI name-value pair, for zero-copy writes.
Constants§
- MAX_
NV_ LENGTH - Maximum length that fits in the FastCGI variable-length integer format.
- MAX_
PARAMS_ RECORD_ BODY - The maximum total byte length of a stream of name-value pairs that can fit in a single FastCGI record (content length is a u16).
Functions§
- decode_
length - Decode a variable-length integer from the reader.
- decode_
length_ from_ slice - Decode a variable-length integer from a byte slice, returning the value and the number of bytes consumed.
- decode_
params - Decode all name-value pairs from a contiguous byte slice (the content of a PARAMS record).
- encode_
params - Encode a list of name-value pairs into a
BytesMutbuffer. - encoded_
length_ size - Number of bytes needed to encode
lenusing the FastCGI variable-length format. - try_
encode_ length - Encode
lenusing the FastCGI variable-length integer format intobuf.