def header

bend-kit-websocket@0.4.0.0 · websocket.bend:452

import bend-kit-websocket@0.4.0.0/websocket.bend as Websocket
import Base

452# The header at the front of p, from octets below 256. It reads at most 14 octets, and is
453# HNeed until all of them are in p. It is checked as soon as it is whole, before its payload.
454def header(p: List<&2, U32>, +masked: Bool) -> Header:
455  match p:
456    case Con{+b0, Con{+b1, t}}:
457      header.b1(U32.is_le(128, b1), t, masked, b0, b1)
458    case _:
459      HNeed{}

Uses (6)

Used by (1)