def export

mylsm-lsm-store@0.6.0.1 · src/transfer/BackupCursorIo.bend:319

import mylsm-lsm-store@0.6.0.1/src/transfer/BackupCursorIo.bend as BackupCursorIo
import Base
import mylsm-lsm-store@0.6.0.1/src/Fs.bend as Fs
import mylsm-lsm-store@0.6.0.1/src/scan/VisibleCursor.bend as VisibleCursor
import mylsm-lsm-store@0.6.0.1/src/transfer/BackupCursor.bend as BackupCursor
import mylsm-lsm-store@0.6.0.1/src/transfer/BackupIo.bend as BackupIo

319# Exports a stable visible cursor through bounded checksummed chunks.
320def export(
321  +destination: String,
322  cursor: VisibleCursor.Cursor,
323  entry_count: Nat,
324  fuel: Nat
325) -> IO(Result<&1, &1, BackupIo.Error, Unit>):
326  +temporary = destination ++ ".backup-060.tmp"
327  do IO<Result<&1, &1, BackupIo.Error, Unit>>:
328    initial : BackupCursor.Step <- IO.pure(BackupCursor.Step,
329      BackupCursor.start(cursor, entry_count))
330    exists : Result<&1, &1, U32 & String, Bool> <- Fs.exists(path.clone(destination))
331    initial.checked(destination, temporary, initial, fuel, exists)

Uses (18)

Used by (1)