Skip to main content

starts_a_request_stream

Function starts_a_request_stream 

Source
pub const fn starts_a_request_stream(ty: MessageType) -> bool
Expand description

Whether ty is one of the six message types draft-17 Section 3.3 lets a bidirectional stream begin with.

The match is exhaustive over MessageType and deliberately has no wildcard arm. That is the drift guard: MessageType is not #[non_exhaustive], so the day a draft gains a message type this stops compiling until someone says here whether the new type opens a request stream. A wildcard would silently answer “no” for it.

Classification is over the typed MessageType, never over a raw u64, because the number alone does not say which registry it came from: on draft-17, 0x10 is GOAWAY as a control message type and also a SUBGROUP_HEADER as a unidirectional stream type.