def Bytes.backup_to.remote.snapshot.opened
mylsm-lsm-store@0.6.0.1 · mylsm.bend:1298
import mylsm-lsm-store@0.6.0.1/mylsm.bend as Mylsm
import Base
import mylsm-lsm-store@0.6.0.1/src/coordinator/Client.bend as OwnerClient
import mylsm-lsm-store@0.6.0.1/src/coordinator/Protocol.bend as CoordinatorProtocol
1298def Bytes.backup_to.remote.snapshot.opened(
1299 path: String,
1300 opened: OwnerClient.Session & Result<&1, &1, OwnerClient.Error, U32>
1301) -> IO(Bytes.Handle & Result<&1, &1, Bytes.Error, Unit>):
1302 match opened:
1303 case (session, Fail{error}):
1304 IO.pure(Bytes.Handle & Result<&1, &1, Bytes.Error, Unit>,
1305 (RemoteByteHandle{session}, Fail{Bytes.owner.error(error)}))
1306 case (session, Done{snapshot_id}):
1307 Bytes.backup_to.remote.snapshot.cloned(path,
1308 OwnerClient.session.clone(session),
1309 CoordinatorProtocol.u32.duplicate.triple(snapshot_id))