def records.step
mylsm-lsm-store@0.6.0.1 · src/Wal.bend:190
import mylsm-lsm-store@0.6.0.1/src/Wal.bend as Wal
import Base
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes
190def records.step(
191 rest: List<&2, Mut>,
192 current: Result<&1, &1, Error, Bytes.Bytes>,
193 acc: List<&1, Bytes.Bytes>
194) -> Result<&1, &1, Error, List<&1, Bytes.Bytes>>:
195 match rest current:
196 case Nil{} Fail{error}:
197 Fail{error}
198 case Nil{} Done{bytes}:
199 Done{List.reverse(&1, Bytes.Bytes, bytes <> acc)}
200 case Con{_mut, _tail} Fail{error}:
201 Fail{error}
202 case Con{mut, tail} Done{bytes}:
203 records.step(tail, record.encode(mut), bytes <> acc)