def allocate_resource_id
import mylsm-lsm-store@0.6.0.1/src/scan/Snapshot.bend as Snapshotimport Base
258# Allocates one nonrecycled owner resource identifier without integer wraparound.
259def allocate_resource_id(
260 allocator: ResourceIdAllocator
261) -> ResourceIdDecision:
262 match allocator:
263 case ResourceIdAllocator{next_id, exhausted}:
264 allocate_resource_id.at_limit(u32.duplicate(next_id), exhausted)