def records.step

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

import mylsm-lsm-store@0.6.0.1/src/SstFile.bend as SstFile
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

339# Continue encoding a record list after the current record has been checked.
340def records.step(
341  rest: List<&2, MemTable.Entry>,
342  current: Result<&1, &1, Error, Bytes.Bytes>,
343  acc: List<&1, Bytes.Bytes>
344) -> Result<&1, &1, Error, List<&1, Bytes.Bytes>>:
345  match rest current:
346    case Nil{} Fail{error}:
347      Fail{error}
348    case Nil{} Done{bytes}:
349      Done{List.reverse(&1, Bytes.Bytes, bytes <> acc)}
350    case Con{_entry, _tail} Fail{error}:
351      Fail{error}
352    case Con{entry, tail} Done{bytes}:
353      records.step(tail, encode_record(entry), bytes <> acc)

Uses (7)

Used by (1)