ByteSstFile.page.build.go: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/ByteSstFile.bend as ByteSstFile Lines 430-464 of mylsm-lsm-store@0.6.0.1/src/ByteSstFile.bend: https://jend.leeeet.dev/read.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteSstFile.bend&start_line=430&end_line=464 import Base import mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend as ByteMemTable import mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockBuilder.bend as ByteBlockBuilder def page.build.go( fuel: Nat, builder: PageBuild, pending: List<&1, ByteMemTable.Entry> & ByteBlockBuilder.Decision, +max_bytes: Nat ) -> Result<&1, &1, Error, PagePlan>: match fuel: case 0n: match builder: case PageBuild{current, _, _, completed, completed_count}: match pending: case (Nil{}, _): Done{page.finish(completed, current, completed_count)} case _: Fail{TooLarge{}} case 1n+rest: match builder: case PageBuild{current, current_bytes, +current_count, completed, completed_count}: match pending: case (Nil{}, _): Done{page.finish(completed, current, completed_count)} case (Con{entry, tail}, decision): match decision: case ByteBlockBuilder.RecordTooLarge{}: Fail{TooLarge{}} case ByteBlockBuilder.Append{+used_bytes}: page.build.go(rest, PageBuild{Con{entry, current}, used_bytes, Nat.add(current_count, 1n), completed, completed_count}, page.next.prepare(tail, Nat.add(current_count, 1n), used_bytes, max_bytes), max_bytes) case ByteBlockBuilder.StartNextBlock{+record_bytes}: page.build.go(rest, page.rollover(entry, current, completed, completed_count, record_bytes), page.next.prepare(tail, 1n, record_bytes, max_bytes), max_bytes) Uses (14): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend&name=Entry https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteSstFile.bend&name=Error https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteSstFile.bend&name=PageBuild https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteSstFile.bend&name=PagePlan https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteSstFile.bend&name=page.finish https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteSstFile.bend&name=page.next.prepare https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteSstFile.bend&name=page.rollover https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockBuilder.bend&name=Decision