def allocate_resource_id.at_limit
mylsm-lsm-store@0.6.0.1 · src/scan/Snapshot.bend:245
import mylsm-lsm-store@0.6.0.1/src/scan/Snapshot.bend as Snapshot
import Base
245def allocate_resource_id.at_limit(
246 copies: U32 & U32,
247 exhausted: Bool
248) -> ResourceIdDecision:
249 match copies:
250 case (next_id, check_id):
251 match exhausted:
252 case True{}:
253 ResourceIdExhausted{ResourceIdAllocator{next_id, exhausted}}
254 case False{}:
255 allocate_resource_id.maximum(u32.duplicate(next_id),
256 U32.is_eq(check_id, 4294967295))