def stream.blocks.count.valid

mylsm-lsm-store@0.6.0.1 · src/SstFile.bend:1152

import mylsm-lsm-store@0.6.0.1/src/SstFile.bend as SstFile
import Base

1152# Accepts a block only when it fits the file's remaining block and entry counts.
1153def stream.blocks.count.valid(
1154  exact: Bool,
1155  +remaining: U32,
1156  +entries_left: U32,
1157  +count: U32
1158) -> Bool:
1159  exact && U32.is_lt(0, remaining) && U32.is_le(count, entries_left) &&
1160    parse.blocks.count.valid(U32.to_nat(remaining), entries_left, count)

Uses (7)

Used by (1)