def Bytes.scan_open.owned.bounds

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

import mylsm-lsm-store@0.6.0.1/mylsm.bend as Mylsm
import Base
import mylsm-lsm-store@0.6.0.1/src/scan/RangeCursor.bend as ByteRangeCursor

1428def Bytes.scan_open.owned.bounds(
1429  handle: Bytes.Handle,
1430  snapshot: Bytes.Snapshot,
1431  copies: ByteRangeCursor.Bounds & ByteRangeCursor.Bounds
1432) -> IO(Bytes.Handle & Result<&1, &1, Bytes.Error, Bytes.Cursor>):
1433  match copies:
1434    case (ByteRangeCursor.Bounds{None{}, None{}, Some{prefix}}, retained):
1435      do IO<Bytes.Handle & Result<&1, &1, Bytes.Error, Bytes.Cursor>>:
1436        opened : Bytes.Snapshot & Result<&1, &1, Bytes.Error, Bytes.Cursor> <-
1437          Bytes.snapshot.scan_prefix(snapshot, prefix)
1438        Bytes.scan_open.owned.cursor(handle, retained, opened)
1439    case (ByteRangeCursor.Bounds{lower, upper, _}, retained):
1440      do IO<Bytes.Handle & Result<&1, &1, Bytes.Error, Bytes.Cursor>>:
1441        opened : Bytes.Snapshot & Result<&1, &1, Bytes.Error, Bytes.Cursor> <-
1442          Bytes.snapshot.scan_range(snapshot, lower, upper)
1443        Bytes.scan_open.owned.cursor(handle, retained, opened)

Uses (14)

Used by (1)