silk.http.http2_headers.
HTTP/2 field validation for requests, responses, and trailers under RFC 9113 section 8.
Import as Message with import silk.http.http2_headers { Message }.
Public declarations: 3.
Section#
pub enum SectionThe expected field section type.
Request#
RequestInitial request fields, including request pseudo-headers.
Response#
ResponseInformational or final response fields, including :status.
Trailers#
TrailersTrailing fields, without pseudo-headers.
Message#
pub struct MessageMessage properties needed for body validation.
Field hasLength#
pub hasLength: boolTrue if Content-Length is present.
Field length#
pub length: u64The declared body length, or zero if absent.
Field status#
pub status: u32Response status, or zero for requests and trailers.
Field head#
pub head: boolTrue for a HEAD request.
Field connect#
pub connect: boolTrue for a CONNECT request.
validate#
pub effect<'call> fn validate<'call, 'data: 'call>(
fields: &'call [Field<'data>],
section: Section,
stream: u32
) -> Message
! ProtocolErrorValidates one complete decoded field section. Violations are stream PROTOCOL_ERRORs. It rejects invalid bytes, pseudo-header order and duplicates, connection fields, and conflicting Content-Length values.
Category: HTTP.
Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, wasm32-wasip1, wasm32-wasip2.