def write.opened

mylsm-lsm-store@0.6.0.1 · src/ByteSstIo.bend:315

import mylsm-lsm-store@0.6.0.1/src/ByteSstIo.bend as ByteSstIo
import Base
import mylsm-lsm-store@0.6.0.1/src/ByteSstFile.bend as ByteSstFile
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

315# Dispatches a validated encoding result after opening the temporary file.
316def write.opened(
317  +directory: String,
318  temporary: String,
319  final_path: String,
320  encoded: Result<&1, &1, ByteSstFile.Error, Bytes.Bytes>,
321  opened: Result<&1, &1, U32 & String, File>
322) -> IO(Result<&1, &1, U32 & String, Unit>):
323  match encoded:
324    case Fail{_}:
325      write.encoder.failed(opened)
326    case Done{bytes}:
327      write.encoded(directory, temporary, final_path, bytes, opened)

Uses (11)

Used by (1)