Struct ringbuffer_iteration::RingBuffer [−][src]
Expand description
An implementation of a ring buffer data structure that creates a “lossy” queue. This is a
simplified version of the generic heapless Queue
with a few constraints relaxed:
- The Item type is at least Copy + Clone
- We do not care about overwritten data in the buffer. Should be able to write indefinitely without error.
An iterator is also defined for RingBuffer
which implements Iterator
,
ExactSizeIterator
, and DoubleEndedIterator
. The iterator begins at the head of the ring
buffer and iterates until it reaches the tail.
Also uses an internal flag overwriting
to allow iteration over the last value in the
ring buffer, giving the structure a capacity of N
rather than the typical ringbuffer capacity
of N-1
.