def parse.header
bend-kit-http2@0.4.0.0 · http2.bend:295
import bend-kit-http2@0.4.0.0/http2.bend as Http2
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
295def parse.header(+max: U32, b: Bytes.Bytes) -> Decode:
296 with_number(Decode, Bytes.uint(b, 0, 3, True{}), b => +len =>
297 with_number(Decode, Bytes.get(b, 3), b => kind =>
298 with_number(Decode, Bytes.get(b, 4), b => flags =>
299 with_number(Decode, Bytes.get.u32be(b, 5), b => stream =>
300 parse.size(U32.is_gt(len, max), max, len, kind, flags, (stream .&. 2147483647 : U32), b)))))