def index.page.decode.copies

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

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

1569def index.page.decode.copies(
1570  reader: IndexMeta,
1571  +offset: Nat,
1572  +remaining: Nat,
1573  actual_hash: SHA.Stream,
1574  root_hash: SHA.Stream,
1575  copies: Bytes.Bytes & Bytes.Bytes,
1576  complete: Bool
1577) -> Result<&1, &1, U32 & String, IndexPageData>:
1578  match copies:
1579    case (for_hash, for_root):
1580      match complete:
1581        case False{}: Fail{corruption("truncated byte SST serialized index")}
1582        case True{}:
1583          index.page.decode.actual(reader, offset, remaining, root_hash,
1584            SHA.stream.update(actual_hash, for_hash), for_root)

Uses (14)

Used by (1)