def Bytes.backup

mylsm-lsm-store@0.6.0.1 · mylsm.bend:1071

import mylsm-lsm-store@0.6.0.1/mylsm.bend as Mylsm
import Base

1071# Opens a stable logical export from one retained database snapshot.
1072def Bytes.backup(handle: Bytes.Handle) -> IO(Bytes.Handle & Result<&1, &1, Bytes.Error, Bytes.BackupStream>):
1073  match handle:
1074    case ByteHandle{_}:
1075      do IO<Bytes.Handle & Result<&1, &1, Bytes.Error, Bytes.BackupStream>>:
1076        snapshot : Bytes.Handle & Result<&1, &1, Bytes.Error, Bytes.Snapshot> <-
1077          Bytes.snapshot(handle)
1078        return Bytes.backup.snapshot(snapshot)
1079    case RemoteByteHandle{session}:
1080      IO.pure(Bytes.Handle & Result<&1, &1, Bytes.Error, Bytes.BackupStream>,
1081        (RemoteByteHandle{session}, Fail{UnsupportedOperation{}}))

Uses (12)

Used by (1)