def heads.found

bend-kit-multipart@0.3.0.0 · multipart.bend:510

import bend-kit-multipart@0.3.0.0/multipart.bend as Multipart
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes

510# buf starts with the CRLF that ended the boundary line, so a match at 0 is an empty block.
511def heads.found(r: Bytes.Bytes & Maybe<&2, U32>, out: List<&1, Item>) -> Step:
512  (buf, hit) = r
513  match hit:
514    case Some{+j}:
515      heads.cut(j, Bytes.slice(buf, 2, (U32.max(j, 2) - 2 : U32)), out)
516    case None{}:
517      wait.big(Heads{}, Bytes.length(buf), out)

Uses (15)

Used by (1)