def open.hash.index

mylsm-lsm-store@0.6.0.1 · src/scan/ByteBlockReader.bend:230

import mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend as ByteBlockReader
import Base
import mylsm-lsm-store@0.6.0.1/src/hub_sha/sha256.bend as SHA
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

230def open.hash.index(
231  file: File,
232  +size: Nat,
233  header: Bytes.Bytes,
234  total: U32,
235  block_count: U32,
236  index_offset: Nat,
237  root_hash: SHA.Stream,
238  result: Result<&1, &1, SHA.StreamError, SHA.Stream>
239) -> IO(Result<&1, &1, U32 & String, Reader>):
240  match result:
241    case Fail{_}:
242      open.failed(file, resource_limit("SST metadata exceeds the SHA-256 input limit"))
243    case Done{index_hash}:
244      IO.pure(Result<&1, &1, U32 & String, Reader>, Done{Reader{file,
245        State{size, header, index_offset, 0n, total, block_count, 0, 0,
246          root_hash, index_hash, None{}, False{}}}})

Uses (17)

Used by (1)