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: 4.
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.
Implementation Copy for Message#
impl Copy for Messagevalidate#
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.
validateExcept#
pub effect<'call> fn validateExcept<'call, 'data: 'call>(
fields: &'call [Field<'data>],
section: Section,
stream: u32,
checked: &[u8]
) -> Message
! ProtocolErrorValidates like validate, except that an :authority equal to checked is not parsed
again. Pass an authority that an earlier validation accepted, such as the one of the previous
request on the connection. An empty checked matches nothing. A CONNECT request and a request
with a Host field always have their authority parsed.
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, x86_64-pc-windows-msvc, wasm64-unknown-unknown.