Struct smooth_buffer::SmoothBuffer
source · pub struct SmoothBuffer<const CAP: usize> { /* private fields */ }
Expand description
Simple fixed size ringbuffer with fast averaging and smoothing. Do not use if the order of retrieval of each element matters.
Implementations§
source§impl<const CAP: usize> SmoothBuffer<CAP>
impl<const CAP: usize> SmoothBuffer<CAP>
pub fn new() -> Self
pub fn clear(&mut self)
pub fn is_empty(&self) -> bool
pub fn max(&self) -> f32
pub fn min(&self) -> f32
pub fn capacity(&self) -> usize
pub fn len(&self) -> usize
pub fn push(&mut self, value: f32)
pub fn iter(&self) -> Iter<'_, f32>
pub fn iter_mut(&mut self) -> IterMut<'_, f32>
Trait Implementations§
Auto Trait Implementations§
impl<const CAP: usize> Freeze for SmoothBuffer<CAP>
impl<const CAP: usize> RefUnwindSafe for SmoothBuffer<CAP>
impl<const CAP: usize> Send for SmoothBuffer<CAP>
impl<const CAP: usize> Sync for SmoothBuffer<CAP>
impl<const CAP: usize> Unpin for SmoothBuffer<CAP>
impl<const CAP: usize> UnwindSafe for SmoothBuffer<CAP>
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