pub struct RingBuffer<T: Clone> { /* private fields */ }Implementations§
Source§impl<T: Clone> RingBuffer<T>
impl<T: Clone> RingBuffer<T>
pub fn new(capacity: usize) -> Self
pub fn push(&mut self, item: T)
pub fn latest(&self) -> Option<&T>
pub fn oldest(&self) -> Option<&T>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn is_full(&self) -> bool
pub fn iter(&self) -> impl Iterator<Item = &T>
pub fn clear(&mut self)
pub fn as_vec(&self) -> Vec<T>
Auto Trait Implementations§
impl<T> Freeze for RingBuffer<T>
impl<T> RefUnwindSafe for RingBuffer<T>where
T: RefUnwindSafe,
impl<T> Send for RingBuffer<T>where
T: Send,
impl<T> Sync for RingBuffer<T>where
T: Sync,
impl<T> Unpin for RingBuffer<T>where
T: Unpin,
impl<T> UnsafeUnpin for RingBuffer<T>
impl<T> UnwindSafe for RingBuffer<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more