Protobuf.utf8.push: def of bend-kit-protobuf@0.2.0.0 Import: import bend-kit-protobuf@0.2.0.0/protobuf.bend as Protobuf Lines 769-787 of bend-kit-protobuf@0.2.0.0/protobuf.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-protobuf@0.2.0.0/protobuf.bend&start_line=769&end_line=787 import Base import bend-kit-bytes@0.3.3.0/bytes.bend as B def utf8.push(width: U32, +c: U32, out: B.Bytes) -> Result<&2, &1, Error, B.Bytes>: match width: case 1: byte(out, c, 2147483647) case 2: do Result<&2, &1, Error, B.Bytes>: a : B.Bytes <- byte(out, (192 .|. (c >> 6n) : U32), 2147483647) byte(a, utf8.cont_byte(c, 0n), 2147483647) case 3: do Result<&2, &1, Error, B.Bytes>: a : B.Bytes <- byte(out, (224 .|. (c >> 12n) : U32), 2147483647) b : B.Bytes <- byte(a, utf8.cont_byte(c, 6n), 2147483647) byte(b, utf8.cont_byte(c, 0n), 2147483647) case _: do Result<&2, &1, Error, B.Bytes>: a : B.Bytes <- byte(out, (240 .|. (c >> 18n) : U32), 2147483647) b : B.Bytes <- byte(a, utf8.cont_byte(c, 12n), 2147483647) d : B.Bytes <- byte(b, utf8.cont_byte(c, 6n), 2147483647) byte(d, utf8.cont_byte(c, 0n), 2147483647) Uses (12): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shrn https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.Con https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.Nil https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=Bytes https://jend.leeeet.dev/definition.txt?path=bend-kit-protobuf@0.2.0.0/protobuf.bend&name=Error https://jend.leeeet.dev/definition.txt?path=bend-kit-protobuf@0.2.0.0/protobuf.bend&name=byte https://jend.leeeet.dev/definition.txt?path=bend-kit-protobuf@0.2.0.0/protobuf.bend&name=utf8.cont_byte