def read_at.exact.length

mylsm-lsm-store@0.6.0.1 · src/scan/ByteBlockReader.bend:166

import mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend as ByteBlockReader
import Base
import mylsm-lsm-store@0.6.0.1/src/SstStreamIo.bend as SstStreamIo
import mylsm-lsm-store@0.6.0.1/src/coordinator/QueuePolicy.bend as QueuePolicy
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

166def read_at.exact.length(
167  needed: U32,
168  copies: Bytes.Bytes & Bytes.Bytes
169) -> Result<&1, &1, U32 & String, SstStreamIo.ExactResult>:
170  match copies:
171    case (measured, retained):
172      match measured:
173        case Bytes.Bytes{len, _}:
174          read_at.exact.complete(retained,
175            QueuePolicy.nat.clone.pair(U32.to_nat(len)), needed)

Uses (10)

Used by (1)