ByteSstFile.decode.apply: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/ByteSstFile.bend as ByteSstFile Lines 862-884 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=862&end_line=884 import Base import mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend as ByteMemTable import mylsm-lsm-store@0.6.0.1/src/ByteWal.bend as ByteWal # Applies each decoded byte mutation while rejecting count mismatches. def decode.apply( fuel: Nat, table: ByteMemTable.Table, mutations: List<&1, ByteWal.Mutation> ) -> Result<&1, &1, Error, ByteMemTable.Table>: match fuel: case 0n: match mutations: case Nil{}: Done{table} case Con{_, _}: Fail{Malformed{}} case 1n+rest: match mutations: case Nil{}: Fail{Malformed{}} case Con{mutation, tail}: match mutation: case ByteWal.Put{key, value}: decode.apply(rest, ByteMemTable.put(table, key, value), tail) case ByteWal.Delete{key}: decode.apply(rest, ByteMemTable.del(table, key), tail) Uses (8): 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=Result https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend&name=Table https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend&name=del https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend&name=put 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/ByteWal.bend&name=Mutation