pub struct OracleSampleRing<T, const N: usize> { /* private fields */ }Expand description
Oracle for crate::SampleRing: oldest value at index 0, eviction
shifts the whole Vec.
Implementations§
Source§impl<T, const N: usize> OracleSampleRing<T, N>
impl<T, const N: usize> OracleSampleRing<T, N>
Sourcepub fn push(&mut self, value: T) -> Option<T>
pub fn push(&mut self, value: T) -> Option<T>
Push one value; mirrors crate::SampleRing::push exactly:
None when accepted without eviction, Some(old) with the evicted
oldest when full, and the pushed value straight back when N == 0.
Trait Implementations§
Source§impl<'a, T, const N: usize> IntoIterator for &'a OracleSampleRing<T, N>
impl<'a, T, const N: usize> IntoIterator for &'a OracleSampleRing<T, N>
Auto Trait Implementations§
impl<T, const N: usize> Forget for OracleSampleRing<T, N>
impl<T, const N: usize> Freeze for OracleSampleRing<T, N>
impl<T, const N: usize> Move for OracleSampleRing<T, N>
impl<T, const N: usize> RefUnwindSafe for OracleSampleRing<T, N>where
T: RefUnwindSafe,
impl<T, const N: usize> Send for OracleSampleRing<T, N>
impl<T, const N: usize> Sync for OracleSampleRing<T, N>
impl<T, const N: usize> Unpin for OracleSampleRing<T, N>
impl<T, const N: usize> UnsafeUnpin for OracleSampleRing<T, N>
impl<T, const N: usize> UnwindSafe for OracleSampleRing<T, N>where
RawVecInner: UnwindSafe,
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