def Utf8.snapshot.scan_prefix.encoded

mylsm-lsm-store@0.6.0.1 · mylsm.bend:2466

import mylsm-lsm-store@0.6.0.1/mylsm.bend as Mylsm
import Base
import bend-kit-bytes@0.3.2.0/bytes.bend as PackedBytes

2466def Utf8.snapshot.scan_prefix.encoded(
2467  snapshot: Bytes.Snapshot,
2468  encoded: Result<&1, &1, Utf8.Error, PackedBytes.Bytes>
2469) -> IO(Utf8.Snapshot & Result<&1, &1, Utf8.Error, Utf8.Cursor>):
2470  match encoded:
2471    case Fail{error}:
2472      IO.pure(Utf8.Snapshot & Result<&1, &1, Utf8.Error, Utf8.Cursor>,
2473        (Utf8Snapshot{snapshot}, Fail{error}))
2474    case Done{bytes}:
2475      do IO<Utf8.Snapshot & Result<&1, &1, Utf8.Error, Utf8.Cursor>>:
2476        pair : Bytes.Snapshot & Result<&1, &1, Bytes.Error, Bytes.Cursor> <-
2477          Bytes.snapshot.scan_prefix(snapshot, bytes)
2478        return Utf8.snapshot.prefix.opened(pair)

Uses (15)

Used by (1)