SstFile.records.step: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/SstFile.bend as SstFile Lines 339-353 of mylsm-lsm-store@0.6.0.1/src/SstFile.bend: https://jend.leeeet.dev/read.txt?path=mylsm-lsm-store@0.6.0.1/src/SstFile.bend&start_line=339&end_line=353 import Base import mylsm-lsm-store@0.6.0.1/src/MemTable.bend as MemTable import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes # Continue encoding a record list after the current record has been checked. def records.step( rest: List<&2, MemTable.Entry>, current: Result<&1, &1, Error, Bytes.Bytes>, acc: List<&1, Bytes.Bytes> ) -> Result<&1, &1, Error, List<&1, Bytes.Bytes>>: match rest current: case Nil{} Fail{error}: Fail{error} case Nil{} Done{bytes}: Done{List.reverse(&1, Bytes.Bytes, bytes <> acc)} case Con{_entry, _tail} Fail{error}: Fail{error} case Con{entry, tail} Done{bytes}: records.step(tail, encode_record(entry), bytes <> acc) Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.reverse https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=Bytes https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/MemTable.bend&name=Entry https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/SstFile.bend&name=Error https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/SstFile.bend&name=encode_record