def Utf8.snapshot.get.encoded

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

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

2403def Utf8.snapshot.get.encoded(
2404  snapshot: Bytes.Snapshot,
2405  encoded: Result<&1, &1, Utf8.Error, PackedBytes.Bytes>
2406) -> IO(Utf8.Snapshot & Result<&1, &1, Utf8.Error, Maybe<&1, String>>):
2407  match encoded:
2408    case Fail{error}:
2409      IO.pure(Utf8.Snapshot & Result<&1, &1, Utf8.Error, Maybe<&1, String>>,
2410        (Utf8Snapshot{snapshot}, Fail{error}))
2411    case Done{key}:
2412      do IO<Utf8.Snapshot & Result<&1, &1, Utf8.Error, Maybe<&1, String>>>:
2413        pair : Bytes.Snapshot &
2414          Result<&1, &1, Bytes.Error, Maybe<&1, PackedBytes.Bytes>> <-
2415            Bytes.snapshot.get(snapshot, key)
2416        return Utf8.snapshot.get.result(pair)

Uses (15)

Used by (1)