def batch.prepare.validated
mylsm-lsm-store@0.6.0.1 · src/ByteDurableDb.bend:1822
import mylsm-lsm-store@0.6.0.1/src/ByteDurableDb.bend as ByteDurableDb
import Base
import mylsm-lsm-store@0.6.0.1/src/ByteWal.bend as ByteWal
1822def batch.prepare.validated(
1823 prepared: Handle & Result<&1, &1, Error, BatchPrepared>
1824) -> IO(Handle & Result<&1, &1, Error, Unit>):
1825 match prepared:
1826 case (next_handle, Fail{error}):
1827 IO.pure(Handle & Result<&1, &1, Error, Unit>, (next_handle, Fail{error}))
1828 case (Handle{path, lock, table, state, original_stats}, Done{Prepared{mutations, base_stats}}):
1829 do IO<Handle & Result<&1, &1, Error, Unit>>:
1830 pair : Handle & Result<&1, &1, Error, Unit> <-
1831 write.counted(path, lock, table, state, ByteWal.Batch{mutations})
1832 return batch.commit.result(original_stats, base_stats, pair)