def append.encoded

mylsm-lsm-store@0.6.0.1 · src/ByteDurableDb.bend:548

import mylsm-lsm-store@0.6.0.1/src/ByteDurableDb.bend as ByteDurableDb
import Base
import mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend as ByteMemTable
import mylsm-lsm-store@0.6.0.1/src/DbLock.bend as DbLock
import mylsm-lsm-store@0.6.0.1/src/scan/VisibleStats.bend as VisibleStats
import mylsm-lsm-store@0.6.0.1/src/Wal.bend as Wal
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

548# Distinguishes pre-append encoding rejection from uncertain host writes.
549def append.encoded(
550  +path: String,
551  lock: DbLock.Lock,
552  table: ByteMemTable.Table,
553  result: Result<&1, &1, Wal.Error, Bytes.Bytes>
554) -> IO(Handle & Result<&1, &1, Error, Unit>):
555  match result:
556    case Fail{_}:
557      IO.pure(Handle & Result<&1, &1, Error, Unit>,
558        (Handle{path, lock, table, Open{}, VisibleStats.Stats{0n, 0n}}, Fail{InvalidArgument{}}))
559    case Done{frame}:
560      append.frames(path, lock, table, ByteMemTable.bytes.clone(frame))

Uses (17)

Used by (1)