def utf8.put.scalar

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

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

161def utf8.put.scalar(
162  cursor: Bytes.Cursor,
163  +scalar: U32,
164  ascii: Bool,
165  two_byte: Bool,
166  three_byte: Bool
167) -> Bytes.Cursor:
168  match ascii two_byte three_byte:
169    case True{} _ _:
170      utf8.put.byte(cursor, scalar)
171    case False{} True{} _:
172      utf8.put.two(cursor, scalar)
173    case False{} False{} True{}:
174      utf8.put.three(cursor, scalar)
175    case False{} False{} False{}:
176      utf8.put.four(cursor, scalar)

Uses (7)

Used by (1)