def scan.entry.checked

mylsm-lsm-store@0.6.0.1 · src/scan/SstCursor.bend:83

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/scan/ByteBlockReader.bend as ByteBlockReader
import mylsm-lsm-store@0.6.0.1/src/scan/ByteRange.bend as ByteRange
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

83def scan.entry.checked(
84  key: Bytes.Bytes,
85  value: Maybe<&1, Bytes.Bytes>,
86  cursor: ByteBlockReader.EntryCursor,
87  bounds: Bounds & Bounds,
88  key_copies: Bytes.Bytes & Bytes.Bytes
89) -> IO(Step):
90  match value:
91    case Some{bytes}:
92      match bounds:
93        case (checked, retained):
94          match checked:
95            case Bounds{lower, upper, prefix}:
96              match key_copies:
97                case (range_key, prefix_key):
98                  scan.entry.choose(
99                    ByteRange.in_range(range_key, lower, upper) &&
100                      scan.prefix(prefix_key, prefix),
101                    key, bytes, cursor, bounds.copy(retained))
102    case None{}:
103      match bounds:
104        case (_, retained): IO.pure(Step, Skip{Active{cursor, retained}})

Uses (15)

Used by (1)