def append

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

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

298def append(out: B.Bytes, part: B.Bytes, +max_size: U32) -> Result<&2, &1, Error, B.Bytes>:
299  B.Bytes{+n, a_buf} = out
300  B.Bytes{+m, b_buf} = part
301  +limit = U32.min(max_size, 2147483647)
302  append.limit(U32.is_le(n, limit) && U32.is_le(m, (limit - n : U32)), B.Bytes{n, a_buf}, B.Bytes{m, b_buf})

Uses (9)

Used by (1)