def get.sst.opened
mylsm-lsm-store@0.6.0.1 · src/ByteDurableDb.bend:1169
import mylsm-lsm-store@0.6.0.1/src/ByteDurableDb.bend as ByteDurableDb
import Base
import mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend as ByteMemTable
import mylsm-lsm-store@0.6.0.1/src/DbLock.bend as DbLock
import mylsm-lsm-store@0.6.0.1/src/scan/SstCursor.bend as SstCursor
import mylsm-lsm-store@0.6.0.1/src/scan/VisibleStats.bend as VisibleStats
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes
1169def get.sst.opened(
1170 +path: String,
1171 lock: DbLock.Lock,
1172 table: ByteMemTable.Table,
1173 query: Bytes.Bytes,
1174 size: Nat,
1175 opened: Result<&1, &1, U32 & String, SstCursor.Cursor>
1176) -> IO(Handle & Result<&1, &1, Error, Maybe<&1, Bytes.Bytes>>):
1177 match opened:
1178 case Fail{(code, message)}:
1179 IO.pure(Handle & Result<&1, &1, Error, Maybe<&1, Bytes.Bytes>>,
1180 (Handle{path, lock, table, Open{}, VisibleStats.Stats{0n, 0n}}, Fail{recovery.error(code, message)}))
1181 case Done{cursor}:
1182 get.sst.loop(Nat.add(size, 2n), path, lock, table, Need{cursor, query})