def Bytes.snapshot.scan_prefix
mylsm-lsm-store@0.6.0.1 · mylsm.bend:980
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
import mylsm-lsm-store@0.6.0.1/src/coordinator/Client.bend as OwnerClient
import mylsm-lsm-store@0.6.0.1/src/coordinator/ByteClient.bend as OwnerByteClient
980def Bytes.snapshot.scan_prefix(
981 snapshot: Bytes.Snapshot,
982 prefix: PackedBytes.Bytes
983) -> IO(Bytes.Snapshot & Result<&1, &1, Bytes.Error, Bytes.Cursor>):
984 match snapshot:
985 case ByteSnapshot{entries}:
986 IO.pure(Bytes.Snapshot & Result<&1, &1, Bytes.Error, Bytes.Cursor>,
987 Bytes.snapshot.scan_prefix.local(snapshot, prefix))
988 case RemoteByteSnapshot{session, +snapshot_id}:
989 do IO<Bytes.Snapshot & Result<&1, &1, Bytes.Error, Bytes.Cursor>>:
990 pair : OwnerClient.Session & Result<&1, &1, OwnerClient.Error, U32> <-
991 OwnerByteClient.snapshot.cursor.open.prefix(session, snapshot_id, prefix)
992 return Bytes.snapshot.cursor.remote(snapshot_id, pair)