def Bytes.create.options.probe.result

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

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

577def Bytes.create.options.probe.result(
578  result: Result<&1, &1, Bytes.Error, Bytes.Handle>
579) -> IO(Result<&1, &1, Bytes.Error, Bytes.Handle>):
580  match result:
581    case Fail{NotFound{}}:
582      IO.pure(Result<&1, &1, Bytes.Error, Bytes.Handle>,
583        Fail{InvalidArgument{}})
584    case Fail{error}:
585      IO.pure(Result<&1, &1, Bytes.Error, Bytes.Handle>, Fail{error})
586    case Done{RemoteByteHandle{session}}:
587      IO.pure(Result<&1, &1, Bytes.Error, Bytes.Handle>,
588        Done{RemoteByteHandle{session}})
589    case Done{ByteHandle{raw}}:
590      do IO<Result<&1, &1, Bytes.Error, Bytes.Handle>>:
591        _closed : Result<&1, &1, RawByteDb.Error, Unit> <- RawByteDb.close(raw)
592        return Fail{AlreadyExists{}}

Uses (9)

Used by (1)