Struct heapless::CircularBuffer
[−]
[src]
pub struct CircularBuffer<T, A> where
A: AsMut<[T]> + AsRef<[T]>,
T: Copy, { /* fields omitted */ }
A circular buffer
Methods
impl<T, A> CircularBuffer<T, A> where
A: AsMut<[T]> + AsRef<[T]>,
T: Copy,
[src]
A: AsMut<[T]> + AsRef<[T]>,
T: Copy,
const fn new(array: A) -> Self
Creates a new empty circular buffer using array
as backup storage
fn capacity(&self) -> usize
Returns the capacity of this buffer
fn push(&mut self, elem: T)
Pushes elem
ent into the buffer
This will overwrite an old value if the buffer is full
Trait Implementations
impl<T, A> Deref for CircularBuffer<T, A> where
A: AsMut<[T]> + AsRef<[T]>,
T: Copy,
[src]
A: AsMut<[T]> + AsRef<[T]>,
T: Copy,