def append.limit

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

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

290# Append checks subtraction before addition, including U32 size overflow.
291def append.limit(ok: Bool, out: B.Bytes, part: B.Bytes) -> Result<&2, &1, Error, B.Bytes>:
292  match ok:
293    case True{}:
294      Done{B.append(out, part)}
295    case False{}:
296      Fail{Limit{}}

Uses (5)

Used by (1)