FormatInspectIo.read.size.checked: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/transfer/FormatInspectIo.bend as FormatInspectIo Lines 87-103 of mylsm-lsm-store@0.6.0.1/src/transfer/FormatInspectIo.bend: https://jend.leeeet.dev/read.txt?path=mylsm-lsm-store@0.6.0.1/src/transfer/FormatInspectIo.bend&start_line=87&end_line=103 import Base import mylsm-lsm-store@0.6.0.1/src/DbLock.bend as DbLock import mylsm-lsm-store@0.6.0.1/src/DurableError.bend as DurableError import mylsm-lsm-store@0.6.0.1/src/transfer/FormatInspect.bend as FormatInspect def read.size.checked( +path: String, lock: DbLock.Lock, +size: Nat, within_limit: Bool ) -> IO(Result<&1, &1, Error, FormatInspect.Inspection>): match within_limit: case True{}: do IO>: opened : Result<&1, &1, U32 & String, File> <- File.open(path ++ "/MANIFEST", "r") read.opened(path, lock, size, opened) case False{}: do IO>: released : Result<&1, &1, DurableError.Error, Unit> <- DbLock.release(lock, "inspect", path) read.limit.released(released) Uses (19): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=File https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=File.open https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/DbLock.bend&name=Lock https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/DbLock.bend&name=release https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/DurableError.bend&name=Error https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/transfer/FormatInspect.bend&name=Inspection https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/transfer/FormatInspectIo.bend&name=Error https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/transfer/FormatInspectIo.bend&name=read.limit.released https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/transfer/FormatInspectIo.bend&name=read.opened