def client.headers.empty
bend-kit-http2@0.4.0.0 · http2.bend:351
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
351def client.headers.empty(first: Bool, end_stream: Bool, id: U32, max: U32, rev: List<&1, Bytes.Bytes>) -> Maybe<&1, List<&1, Bytes.Bytes>>:
352 match first:
353 case False{}:
354 Some{List.reverse(&1, Bytes.Bytes, rev)}
355 case True{}:
356 Maybe.map(&1, Bytes.Bytes, List<&1, Bytes.Bytes>,
357 b => List.reverse(&1, Bytes.Bytes, Con{b, rev}),
358 client.frame(encode(max, Frame{1, (4 + Bool.pick(U32, end_stream, 1, 0) : U32), id, Bytes.new(0)})))