def create.opened

mylsm-lsm-store@0.6.0.1 · src/ByteWalIo.bend:457

import mylsm-lsm-store@0.6.0.1/src/ByteWalIo.bend as ByteWalIo
import Base
import mylsm-lsm-store@0.6.0.1/src/ByteWal.bend as ByteWal
import mylsm-lsm-store@0.6.0.1/src/Fs.bend as Fs

457def create.opened(
458  opened: Result<&1, &1, U32 & String, File>,
459  +path: String
460) -> IO(Result<&1, &1, U32 & String, Unit>):
461  match opened:
462    case Fail{failure}:
463      IO.pure(Result<&1, &1, U32 & String, Unit>, Fail{failure})
464    case Done{file}:
465      do IO<Result<&1, &1, U32 & String, Unit>>:
466        pair : File & Result<&1, &1, U32 & String, Unit> <-
467          Fs.write_bytes(file, ByteWal.header())
468        create.written(pair, path)

Uses (12)

Used by (1)