pub struct Unwrapper<Q> { /* private fields */ }
Expand description
Overflow unwrapper.
This is unwrapping as in the phase and overflow unwrapping context, not
unwrapping as in the Result
/Option
context.
Implementations§
source§impl<Q> Unwrapper<Q>where
Q: 'static + WrappingAdd + Copy,
impl<Q> Unwrapper<Q>where
Q: 'static + WrappingAdd + Copy,
sourcepub fn update<P>(&mut self, x: P) -> P
pub fn update<P>(&mut self, x: P) -> P
Feed a new sample..
Args:
x
: New sample
Returns:
The (wrapped) difference x - x_old
sourcepub fn wraps<P, const S: u32>(&self) -> Pwhere
Q: AsPrimitive<P> + Shr<u32, Output = Q>,
P: 'static + Copy + WrappingAdd + Signed + BitAnd<u32, Output = P>,
pub fn wraps<P, const S: u32>(&self) -> Pwhere
Q: AsPrimitive<P> + Shr<u32, Output = Q>,
P: 'static + Copy + WrappingAdd + Signed + BitAnd<u32, Output = P>,
The current number of wraps
sourcepub fn phase<P>(&self) -> Pwhere
P: 'static + Copy,
Q: AsPrimitive<P>,
pub fn phase<P>(&self) -> Pwhere
P: 'static + Copy,
Q: AsPrimitive<P>,
The current phase
Trait Implementations§
source§impl<'de, Q> Deserialize<'de> for Unwrapper<Q>where
Q: Deserialize<'de>,
impl<'de, Q> Deserialize<'de> for Unwrapper<Q>where
Q: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<Q: Copy> Copy for Unwrapper<Q>
Auto Trait Implementations§
impl<Q> Freeze for Unwrapper<Q>where
Q: Freeze,
impl<Q> RefUnwindSafe for Unwrapper<Q>where
Q: RefUnwindSafe,
impl<Q> Send for Unwrapper<Q>where
Q: Send,
impl<Q> Sync for Unwrapper<Q>where
Q: Sync,
impl<Q> Unpin for Unwrapper<Q>where
Q: Unpin,
impl<Q> UnwindSafe for Unwrapper<Q>where
Q: 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)