def Bytes.put

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

import mylsm-lsm-store@0.6.0.1/mylsm.bend as Mylsm
import Base
import bend-kit-bytes@0.3.2.0/bytes.bend as PackedBytes
import mylsm-lsm-store@0.6.0.1/src/ByteDurableDb.bend as RawByteDb
import mylsm-lsm-store@0.6.0.1/src/coordinator/Client.bend as OwnerClient
import mylsm-lsm-store@0.6.0.1/src/coordinator/ByteClient.bend as OwnerByteClient

669def Bytes.put(
670  handle: Bytes.Handle,
671  key: PackedBytes.Bytes,
672  value: PackedBytes.Bytes
673) -> IO(Bytes.Handle & Result<&1, &1, Bytes.Error, Unit>):
674  match handle:
675    case ByteHandle{raw}:
676      do IO<Bytes.Handle & Result<&1, &1, Bytes.Error, Unit>>:
677        pair : RawByteDb.Handle & Result<&1, &1, RawByteDb.Error, Unit> <- RawByteDb.put(raw, key, value)
678        return Bytes.put.result(pair)
679    case RemoteByteHandle{session}:
680      do IO<Bytes.Handle & Result<&1, &1, Bytes.Error, Unit>>:
681        pair : OwnerClient.Session & Result<&1, &1, OwnerClient.Error, Unit> <-
682          OwnerByteClient.put(session, key, value)
683        return Bytes.owner.unit.result(pair)

Uses (17)

Used by (0)

No other definition uses this definition.