pub struct Ring<T, const N: usize> { /* private fields */ }Expand description
Append only data structure, replace oldest element when reach maximum capacity of N elements
Implementations§
Source§impl<T: Copy + Default + PartialOrd + Sub<Output = T> + Add<Output = T> + Mul<Output = T> + Div<Output = T> + Into<f32>, const N: usize> Ring<T, N>
impl<T: Copy + Default + PartialOrd + Sub<Output = T> + Add<Output = T> + Mul<Output = T> + Div<Output = T> + Into<f32>, const N: usize> Ring<T, N>
Source§impl<T: Copy + Default + PartialOrd + Sub<Output = T> + Add<Output = T> + Mul<Output = T> + Div<Output = T> + Into<f64>, const N: usize> Ring<T, N>
impl<T: Copy + Default + PartialOrd + Sub<Output = T> + Add<Output = T> + Mul<Output = T> + Div<Output = T> + Into<f64>, const N: usize> Ring<T, N>
Sourcepub fn rescaled_iter(
&self,
current: Range<T>,
desired: Range<T>,
) -> RescaleIterator<'_, T, N>
pub fn rescaled_iter( &self, current: Range<T>, desired: Range<T>, ) -> RescaleIterator<'_, T, N>
Returns an iterator over the Ring on which values are rescaled according to the desired
range
Trait Implementations§
Auto Trait Implementations§
impl<T, const N: usize> Freeze for Ring<T, N>where
T: Freeze,
impl<T, const N: usize> RefUnwindSafe for Ring<T, N>where
T: RefUnwindSafe,
impl<T, const N: usize> Send for Ring<T, N>where
T: Send,
impl<T, const N: usize> Sync for Ring<T, N>where
T: Sync,
impl<T, const N: usize> Unpin for Ring<T, N>where
T: Unpin,
impl<T, const N: usize> UnwindSafe for Ring<T, N>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