def trim
import bendvy-ecs-core@0.1.0.4/machine_stream_queue.bend as MachineStreamQueueimport Base
61def trim(~E:Data,queue:Queue<E>,boundary:Nat,capacity:Nat) -> Queue<E>:
62 match queue:
63 case Queue{front,back,size,dropped,+batches}:capacity_pass(~E,past_loop(~E,Nat.add(batches,1n),Queue{front,back,size,dropped,batches},boundary),capacity)