def header.bytes.counts
mylsm-lsm-store@0.6.0.1 · src/transfer/Backup.bend:163
import mylsm-lsm-store@0.6.0.1/src/transfer/Backup.bend as Backup
import Base
import mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend as ByteMemTable
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes
163def header.bytes.counts(
164 entries: List<&1, ByteMemTable.Entry>,
165 entry_counts: U32 & U32,
166 block_counts: U32 & U32,
167 +block_index: U32
168) -> Stream & Bytes.Bytes:
169 match entry_counts:
170 case (state_entries, encoded_entries):
171 match block_counts:
172 case (state_blocks, encoded_blocks):
173 (Stream{Blocks{}, entries, state_entries, state_blocks, block_index},
174 Bytes.concat([magic(), u32.bytes(1), u32.bytes(encoded_entries),
175 u32.bytes(encoded_blocks)]))