def scan.entry.choose
mylsm-lsm-store@0.6.0.1 · src/scan/SstCursor.bend:66
import mylsm-lsm-store@0.6.0.1/src/scan/SstCursor.bend as SstCursor
import Base
import mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend as ByteMemTable
import mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend as ByteBlockReader
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes
66def scan.entry.choose(
67 valid: Bool,
68 key: Bytes.Bytes,
69 value: Bytes.Bytes,
70 cursor: ByteBlockReader.EntryCursor,
71 bounds: Bounds & Bounds
72) -> IO(Step):
73 match valid:
74 case True{}:
75 match bounds:
76 case (item_bounds, _):
77 IO.pure(Step, Item{ByteMemTable.Entry{key, Some{value}},
78 Active{cursor, item_bounds}})
79 case False{}:
80 match bounds:
81 case (_, skip_bounds): IO.pure(Step, Skip{Active{cursor, skip_bounds}})