def file.multi.finish

mylsm-lsm-store@0.6.0.1 · src/ByteSstFile.bend:776

import mylsm-lsm-store@0.6.0.1/src/ByteSstFile.bend as ByteSstFile
import Base
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

776def file.multi.finish(
777  level: U32,
778  collected: BlocksCollected
779) -> Result<&1, &1, Error, Bytes.Bytes>:
780  match collected:
781    case BlocksCollected{blocks, checksums, index_bytes, block_count, entry_count}:
782      +total = U32.to_nat(entry_count)
783      file.multi.output(clone.split(Bytes.concat([header.magic(),
784        u32.bytes(level), u32.bytes(U32.from_nat(total)),
785        u32.bytes(block_count)])), blocks, checksums,
786        clone.split(index_bytes), U32.from_nat(total))

Uses (13)

Used by (1)