def parse.multi.go

mylsm-lsm-store@0.6.0.1 · src/ByteSstFile.bend:1831

import mylsm-lsm-store@0.6.0.1/src/ByteSstFile.bend as ByteSstFile
import Base
import mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend as ByteMemTable
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

1831def parse.multi.go(
1832  fuel: Nat,
1833  source: Bytes.Bytes,
1834  pending: Result<&1, &1, Error, MultiRead>
1835) -> Result<&1, &1, Error, ByteMemTable.Table>:
1836  match fuel:
1837    case 0n:
1838      match pending:
1839        case Fail{error}: Fail{error}
1840        case Done{state}:
1841          match state:
1842            case MultiRead{_, _, _, _, level, total, decoded, table}:
1843              parse.multi.complete(source, table, level,
1844                Nat.is_eq(total, decoded))
1845    case 1n+rest:
1846      match pending:
1847        case Fail{error}: Fail{error}
1848        case Done{state}:
1849          parse.multi.go(rest, source, parse.multi.step(state))

Uses (9)

Used by (1)