def parse.text.start
mylsm-lsm-store@0.6.0.1 · src/SstFile.bend:578
import mylsm-lsm-store@0.6.0.1/src/SstFile.bend as SstFile
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
578def parse.text.start(
579 cursor: Bytes.Cursor,
580 +length: U32,
581 empty: Bool
582) -> Bytes.Cursor & Result<&1, &1, Error, String>:
583 match empty:
584 case True{}:
585 parse.text.go(0n, DecodedText{cursor, Some{0}},
586 StorageBytes.Utf8State{0, 128, 191, 0, SNil{}, True{}})
587 case False{}:
588 parse.text.go(U32.to_nat(length), parse.text.wrap(Bytes.Cursor.u8(cursor)),
589 StorageBytes.Utf8State{0, 128, 191, 0, SNil{}, True{}})