Std.RingBuffer
12 public declarations
- capacity
&Std.RingBuffer.RingBuffer -> IntReturns the total power-of-two capacity of the buffer.
- clear
&Std.RingBuffer.RingBuffer -> Std.RingBuffer.RingBufferClears all elements from the ring buffer.
- create
Int -> Std.RingBuffer.RingBufferCreates a ring buffer whose capacity is rounded up to the nearest power of two (min 4).
- isEmpty
&Std.RingBuffer.RingBuffer -> BoolWhether the buffer contains no elements.
- isFull
&Std.RingBuffer.RingBuffer -> BoolWhether the buffer has reached maximum capacity.
- peek
&Std.RingBuffer.RingBuffer -> Option[Int]Peeks at the item at the head of the buffer without removing it.
- pop
&Std.RingBuffer.RingBuffer -> Option[Std.RingBuffer.PopResult]Dequeues an item from the head of the buffer. Returns None if the buffer is empty.
- PopResult
The result of a successful pop operation containing the updated buffer and the dequeued item.
- push
&Std.RingBuffer.RingBuffer -> Int -> Option[Std.RingBuffer.RingBuffer]Enqueues an item at the tail of the buffer. Returns None if the buffer is full.
- RingBuffer
A bounded, power-of-two circular FIFO ring buffer with branchless bitmask wrapping.
- size
&Std.RingBuffer.RingBuffer -> IntReturns the number of elements currently stored.
- toArray
&Std.RingBuffer.RingBuffer -> Array[Int]Returns the elements in FIFO order from head to tail.
