def stream.blocks.result

mylsm-lsm-store@0.6.0.1 · src/SstFile.bend:1227

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

1227# Propagates parse failures without returning a partial block.
1228def stream.blocks.result(
1229  state: BlockStreamState,
1230  pair: Bytes.Cursor & Result<&1, &1, Error, ParsedBlock>
1231) -> Result<&1, &1, Error, BlockStreamOutput>:
1232  match pair:
1233    case (_, Fail{error}):
1234      Fail{error}
1235    case (cursor, Done{block}):
1236      stream.blocks.consumed(Bytes.Cursor.remaining(cursor), state, block)

Uses (10)

Used by (1)