def Bytes.snapshot.scan_range

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

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

964def Bytes.snapshot.scan_range(
965  snapshot: Bytes.Snapshot,
966  lower: Maybe<&1, PackedBytes.Bytes>,
967  upper: Maybe<&1, PackedBytes.Bytes>
968) -> IO(Bytes.Snapshot & Result<&1, &1, Bytes.Error, Bytes.Cursor>):
969  match snapshot:
970    case ByteSnapshot{entries}:
971      IO.pure(Bytes.Snapshot & Result<&1, &1, Bytes.Error, Bytes.Cursor>,
972        Bytes.snapshot.scan_range.local(snapshot, lower, upper))
973    case RemoteByteSnapshot{session, +snapshot_id}:
974      do IO<Bytes.Snapshot & Result<&1, &1, Bytes.Error, Bytes.Cursor>>:
975        pair : OwnerClient.Session & Result<&1, &1, OwnerClient.Error, U32> <-
976          OwnerByteClient.snapshot.cursor.open.range(session, snapshot_id,
977            lower, upper)
978        return Bytes.snapshot.cursor.remote(snapshot_id, pair)

Uses (16)

Used by (2)