type WSt
import bend-kube-runtime@0.2.0.0/src/ws.bend as Wsimport Base
14# Where the decoder is.
15# WHead: before a frame's first byte
16# WLen: before the byte with the mask bit and the 7-bit length
17# WExt: need more bytes of a 16- or 64-bit length
18# WKey: need more bytes of the masking key
19# WPay: left bytes of payload to go, key rotated to the next byte
20# WBad: a frame the decoder refuses; it stays here
21type WSt is Data:
22 WHead{}
23 WLen{fin: Bool, op: U32}
24 WExt{fin: Bool, op: U32, masked: Bool, need: U32, len: U32}
25 WKey{fin: Bool, op: U32, len: U32, need: U32, key: List<&2, U32>}
26 WPay{fin: Bool, op: U32, left: U32, key: List<&2, U32>, acc: List<&2, U32>}
27 WBad{why: String}