def close.unsupported

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

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/scan/VisibleCursor.bend as VisibleCursor
import mylsm-lsm-store@0.6.0.1/src/transfer/BackupIo.bend as BackupIo

106# Closes backup resources and preserves an unsupported source platform error.
107def close.unsupported(
108  file: File,
109  +directory: String,
110  cursor: Maybe<&1, VisibleCursor.Cursor>
111) -> IO(Result<&1, &1, BackupIo.Error, Unit>):
112  match cursor:
113    case Some{reader}:
114      do IO<Result<&1, &1, BackupIo.Error, Unit>>:
115        _closed_cursor : Result<&1, &1, U32 & String, Unit> <-
116          VisibleCursor.close(reader)
117        _closed_file : Unit <- File.close(file)
118        cleanup(directory)
119        return Fail{BackupIo.UnsupportedPlatform{}}
120    case None{}:
121      do IO<Result<&1, &1, BackupIo.Error, Unit>>:
122        _closed_file : Unit <- File.close(file)
123        cleanup(directory)
124        return Fail{BackupIo.UnsupportedPlatform{}}

Uses (15)

Used by (1)