def packed.chunk.at

emerging-ezhttp@0.21.0.0 · src/packed.bend:96

import emerging-ezhttp@0.21.0.0/src/packed.bend as Packed
import Base
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

96# a chunk-size line that ends at i, or none ends: the body ends there
97def packed.chunk.at(r: Bytes.Bytes & Maybe<&2, U32>, +p: U32,
98  +len: U32, acc: List<&1, Bytes.Bytes>,
99  go: Bytes.Bytes -> U32 -> List<&1, Bytes.Bytes> -> Parts) -> Parts:
100  (b, at) = r
101  match at:
102    case None{}:
103      Parts{acc}
104    case Some{+i}:
105      packed.chunk.line(packed.text(b, p, (i - p : U32)), (i + 2 : U32),
106        len, acc, go)

Uses (11)

Used by (1)