pub struct Limits {
pub max_head_bytes: usize,
pub max_fields: usize,
pub max_chunk_line: usize,
pub max_frame_size: u32,
}Expand description
Bounds a decoder applies to remote input.
Every decode entry point in this crate takes one, by value. There is no way
to switch a bound off; usize::MAX still cannot make a decoder read past
its input, but it lets a peer’s declaration through, which is exactly what
the type exists to stop.
Fields§
§max_head_bytes: usizeThe largest head, in octets.
An HTTP/1.1 request or status line with its field lines and the empty line that ends them; a chunked body’s trailer section; a decoded HTTP/2 or HTTP/3 field section counted as RFC 9113 §6.5.2 counts it (name plus value plus 32 per field); and an HTTP/3 HEADERS frame payload.
max_fields: usizeThe largest number of fields in one field section.
max_chunk_line: usizeThe largest chunk-size line, chunk extensions and line ending included.
max_frame_size: u32The largest HTTP/2 frame payload, and the largest HTTP/3 frame payload other than DATA and HEADERS.
Implementations§
Source§impl Limits
impl Limits
Sourcepub const DEFAULT: Self
pub const DEFAULT: Self
The defaults: DEFAULT_MAX_HEAD_BYTES, DEFAULT_MAX_FIELDS,
DEFAULT_MAX_CHUNK_LINE and DEFAULT_MAX_FRAME_SIZE.