def stream.update.state.lengths

mylsm-lsm-store@0.6.0.1 · src/hub_sha/sha256.bend:355

import mylsm-lsm-store@0.6.0.1/src/hub_sha/sha256.bend as Sha256
import Base
import mylsm-lsm-store@0.6.0.1/src/hub_sha/state.bend as S
import bend-kit-bytes@0.3.2.0/bytes.bend as Packed

355def stream.update.state.lengths(
356  +compressed: S.State,
357  tail: Packed.Bytes,
358  incoming: Packed.Bytes,
359  lengths: Nat & Nat,
360  totals: Nat & Nat
361) -> Result<&1, &1, StreamError, Stream>:
362  match lengths:
363    case (for_update, for_limit):
364      match totals:
365        case (for_update_total, for_limit_total):
366          stream.update.checked(compressed, tail, incoming,
367            U32.from_nat(for_update), for_update_total,
368            Nat.is_le(Nat.add(for_limit_total, for_limit), 4294967295n))

Uses (12)

Used by (1)