def encode.checked

bend-kit-http2@0.4.0.0 · http2.bend:257

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

257def encode.checked(c: Checked) -> Result<&1, &1, Error, Bytes.Bytes>:
258  match c:
259    case Invalid{e}:
260      Fail{e}
261    case Valid{Frame{+kind, +flags, +stream, payload}}:
262      encode.flags(U32.is_eq((flags .&. U32.not(allowed(kind)) : U32), 0), kind, flags, stream, payload)

Uses (11)

Used by (1)