def inspect.canonical

mylsm-lsm-store@0.6.0.1 · src/transfer/FormatInspectIo.bend:156

import mylsm-lsm-store@0.6.0.1/src/transfer/FormatInspectIo.bend as FormatInspectIo
import Base
import mylsm-lsm-store@0.6.0.1/src/Fs.bend as Fs
import mylsm-lsm-store@0.6.0.1/src/transfer/FormatInspect.bend as FormatInspect

156def inspect.canonical(
157  result: Result<&1, &1, U32 & String, String>
158) -> IO(Result<&1, &1, Error, FormatInspect.Inspection>):
159  match result:
160    case Fail{error}:
161      match error:
162        case (code, message):
163          IO.pure(Result<&1, &1, Error, FormatInspect.Inspection>,
164            Fail{Host{code, message}})
165    case Done{+path}:
166      do IO<Result<&1, &1, Error, FormatInspect.Inspection>>:
167        exists : Result<&1, &1, U32 & String, Bool> <- Fs.exists(path ++ "/LOCK")
168        inspect.lock.present(path, exists)

Uses (14)

Used by (1)