def validate_count

mylsm-lsm-store@0.6.0.1 · src/DurableBatchPolicy.bend:119

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

119# Rejects empty and oversized batches before writing.
120def validate_count(count: Nat) -> Validation:
121  match count:
122    case 0n:
123      EmptyBatch{}
124    case count:
125      Bool.pick(Validation, within_batch_count(count), ValidBatch{}, BatchCountExceeded{})

Uses (4)

Used by (1)