def push

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

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

565# The input with a read after it. Decoded octets are dropped first, so each octet is
566# copied once for the frame it ends up in; when there are none, the read goes into the same buffer.
567def push(c: Bytes.Cursor, read: Bytes.Bytes) -> Bytes.Cursor:
568  Bytes.Cursor{Bytes.Bytes{+n, buf}, +pos, start, +end} = c
569  push.when(Bool.and(U32.is_eq(pos, 0), U32.is_eq(end, n)), Bytes.Bytes{n, buf}, pos, end, read)

Uses (5)

Used by (1)