SstFile.parse.text.go: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/SstFile.bend as SstFile Lines 560-576 of mylsm-lsm-store@0.6.0.1/src/SstFile.bend: https://jend.leeeet.dev/read.txt?path=mylsm-lsm-store@0.6.0.1/src/SstFile.bend&start_line=560&end_line=576 import Base import mylsm-lsm-store@0.6.0.1/src/StorageBytes.bend as StorageBytes import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes # Read exactly n UTF-8 bytes from a bounded cursor without materializing a slice. def parse.text.go( remaining: Nat, read: TextRead, state: StorageBytes.Utf8State ) -> Bytes.Cursor & Result<&1, &1, Error, String>: match remaining read: case 0n DecodedText{cursor, _}: parse.text.finish(cursor, StorageBytes.utf8.scan.fin(state)) case 1n+0n DecodedText{cursor, Some{+byte}}: parse.text.finish(cursor, StorageBytes.utf8.scan.fin( StorageBytes.utf8.step(state, byte))) case 1n+1n+rest DecodedText{cursor, Some{+byte}}: parse.text.go(1n+rest, parse.text.wrap(Bytes.Cursor.u8(cursor)), StorageBytes.utf8.step(state, byte)) case 1n+_ DecodedText{cursor, None{}}: (cursor, Fail{Malformed{}}) Uses (15): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=Cursor https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=Cursor.u8 https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/SstFile.bend&name=Error https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/SstFile.bend&name=TextRead https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/SstFile.bend&name=parse.text.finish https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/SstFile.bend&name=parse.text.wrap https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/StorageBytes.bend&name=Utf8State https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/StorageBytes.bend&name=utf8.scan.fin https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/StorageBytes.bend&name=utf8.step