def file.opened

mylsm-lsm-store@0.6.0.1 · src/transfer/BackupOwnerCursorIo.bend:305

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

305def file.opened(
306  +destination: String,
307  +temporary: String,
308  source: OwnerSource,
309  initial: BackupCursor.Step,
310  fuel: Nat,
311  opened: Result<&1, &1, U32 & String, File>
312) -> IO(Result<&1, &1, BackupIo.Error, Unit>):
313  match opened:
314    case Fail{error}:
315      do IO<Result<&1, &1, BackupIo.Error, Unit>>:
316        _closed : Unit <- close.failed.source.no_file(source)
317        BackupCursorIo.cleanup(temporary)
318        initial.failed.io(initial, error)
319    case Done{file}:
320      loop(fuel, destination, temporary, Output{file, source, initial})

Uses (17)

Used by (1)