def byte.limit

bend-kit-protobuf@0.2.0.0 · protobuf.bend:304

import bend-kit-protobuf@0.2.0.0/protobuf.bend as Protobuf
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as B

304def byte.limit(ok: Bool, +n: U32, buf: Array<U32>, v: U32) -> Result<&2, &1, Error, B.Bytes>:
305  match ok:
306    case False{}:
307      Fail{Limit{}}
308    case True{}:
309      Done{B.Bytes{(n + 1 : U32), B.poke(B.grow(n, buf, (n + 1 : U32)), n, v)}}

Uses (9)

Used by (1)