def read.table.size.checked

mylsm-lsm-store@0.6.0.1 · src/SstStreamIo.bend:380

import mylsm-lsm-store@0.6.0.1/src/SstStreamIo.bend as SstStreamIo
import Base
import mylsm-lsm-store@0.6.0.1/src/Sstable.bend as Sstable

380def read.table.size.checked(
381  +path: String,
382  +size: Nat,
383  valid: Bool
384) -> IO(Result<&1, &1, U32 & String, Sstable.Table>):
385  match valid:
386    case False{}:
387      IO.pure(Result<&1, &1, U32 & String, Sstable.Table>,
388        Fail{(corruption_error_code(), "malformed or oversized SST")})
389    case True{}:
390      do IO<Result<&1, &1, U32 & String, Sstable.Table>>:
391        opened : Result<&1, &1, U32 & String, File> <- File.open(path, "r")
392        read.table.opened(size, opened)

Uses (15)

Used by (2)