Skip to main content

Module params

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).
NvPairRef
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 BytesMut buffer.
encoded_length_size
Number of bytes needed to encode len using the FastCGI variable-length format.
try_encode_length
Encode len using the FastCGI variable-length integer format into buf.