def read.bytes
mylsm-lsm-store@0.6.0.1 · src/coordinator/OwnerGenerationIo.bend:60
import mylsm-lsm-store@0.6.0.1/src/coordinator/OwnerGenerationIo.bend as OwnerGenerationIo
import Base
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes
60def read.bytes(
61 file: File,
62 result: Result<&1, &1, U32 & String, Bytes.Bytes>
63) -> IO(Result<&1, &1, Error, U32>):
64 match result:
65 case Fail{error}:
66 do IO<Result<&1, &1, Error, U32>>:
67 _closed : Unit <- File.close(file)
68 return Fail{host(error)}
69 case Done{bytes}:
70 do IO<Result<&1, &1, Error, U32>>:
71 _closed : Unit <- File.close(file)
72 return decode(bytes, 4n)