def decode_checked

mylsm-lsm-store@0.6.0.1 · src/StorageBytes.bend:206

import mylsm-lsm-store@0.6.0.1/src/StorageBytes.bend as StorageBytes
import Base
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

206# Decode bytes after strict RFC 3629 validation.
207def decode_checked(bytes: Bytes.Bytes) -> Result<&1, &1, U32 & String, String>:
208  match bytes:
209    case Bytes.Bytes{len, buf}:
210      utf8.scan(U32.to_nat(len), 0, Bytes.peek(buf, 0), Utf8State{0, 128, 191, 0, SNil{}, True{}})

Uses (10)

Used by (1)