def Bytes.snapshot.cursor.ready

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

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/ByteMemTable.bend as ByteMemTable
import mylsm-lsm-store@0.6.0.1/src/scan/RangeCursor.bend as ByteRangeCursor

877def Bytes.snapshot.cursor.ready(
878  snapshot_entries: List<&1, ByteMemTable.Entry>,
879  cursor_entries: List<&1, ByteMemTable.Entry>,
880  lower: Maybe<&1, PackedBytes.Bytes> & Maybe<&1, PackedBytes.Bytes>,
881  bounds: ByteRangeCursor.Bounds
882) -> Bytes.Snapshot & Bytes.Cursor:
883  match lower:
884    case (seek_lower, retained_lower):
885      match bounds:
886        case ByteRangeCursor.Bounds{_, upper, prefix}:
887          (ByteSnapshot{snapshot_entries}, ByteCursor{
888            ByteRangeCursor.open(ByteRangeCursor.seek(cursor_entries, seek_lower)),
889            ByteRangeCursor.Bounds{retained_lower, upper, prefix}})

Uses (11)

Used by (1)