def restore

mylsm-lsm-store@0.6.0.1 · src/transfer/RestoreIo.bend:431

import mylsm-lsm-store@0.6.0.1/src/transfer/RestoreIo.bend as RestoreIo
import Base
import mylsm-lsm-store@0.6.0.1/src/Fs.bend as Fs
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

431# Validates an exchange before staging and atomically publishing a database.
432def restore(
433  +destination: String,
434  input: Bytes.Bytes
435) -> IO(Result<&1, &1, Error, Unit>):
436  +temporary = path.clone(destination ++ ".restore-060.tmp")
437  do IO<Result<&1, &1, Error, Unit>>:
438    exists : Result<&1, &1, U32 & String, Bool> <- Fs.exists(path.clone(destination))
439    destination.checked(destination, temporary, input, exists)

Uses (14)

Used by (2)