Trait RingBuffer

Source
pub trait RingBuffer<T> {
    // Required methods
    fn current(&self) -> &T;
    fn current_mut(&mut self) -> &mut T;
    fn next(&mut self);
    fn current_index(&self) -> usize;
}
Expand description

General trait for ring buffers.

Required Methods§

Source

fn current(&self) -> &T

Get a borrow the current item.

Source

fn current_mut(&mut self) -> &mut T

Get a mutable borrow to the current item.

Source

fn next(&mut self)

Move to the next item in the ring buffer.

Source

fn current_index(&self) -> usize

Implementors§

Source§

impl<T> RingBuffer<T> for BoxRingBuffer<T>

Source§

impl<T, const SIZE: usize> RingBuffer<T> for InlineRingBuffer<T, SIZE>