def inspect.promised
bend-kit-http2@0.4.0.0 · http2.bend:167
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
167def inspect.promised(+kind: U32, +flags: U32, +stream: U32, +len: U32, +pad: U32, b: Bytes.Bytes) -> Checked:
168 match kind:
169 case 5:
170 +prefix = Bool.pick(U32, has(flags, 8), 1, 0)
171 with_number(Checked, Bytes.get.u32be(b, prefix), b => promised =>
172 checked(rules(kind, flags, stream, len, pad, (promised .&. 2147483647 : U32), 0, None{}), kind, flags, stream, b))
173 case _:
174 checked(rules(kind, flags, stream, len, pad, 0, 0, None{}), kind, flags, stream, b)