pub struct MotionDecay { /* private fields */ }Expand description
One deterministic integer exponential-decay curve over pair recency rank.
Implementations§
Source§impl MotionDecay
impl MotionDecay
pub const DEFAULT_PEAK_INTENSITY: u16 = u16::MAX
pub const DEFAULT_HALF_LIFE_RANKS: u8 = 1
pub const DEFAULT: Self
pub const fn new(peak_intensity: u16, half_life_ranks: NonZeroU8) -> Self
pub const fn peak_intensity(self) -> u16
pub const fn half_life_ranks(self) -> NonZeroU8
Sourcepub const fn weight_at(self, rank_from_newest: u32) -> u16
pub const fn weight_at(self, rank_from_newest: u32) -> u16
Weight for a pair where rank zero is the newest pair in its continuity segment.
Sourcepub const fn live_window(self) -> u32
pub const fn live_window(self) -> u32
Number of recency ranks that can contribute a nonzero weight.
Trait Implementations§
Source§impl Clone for MotionDecay
impl Clone for MotionDecay
Source§fn clone(&self) -> MotionDecay
fn clone(&self) -> MotionDecay
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for MotionDecay
Source§impl Debug for MotionDecay
impl Debug for MotionDecay
Source§impl Default for MotionDecay
impl Default for MotionDecay
Source§impl<'de> Deserialize<'de> for MotionDecay
impl<'de> Deserialize<'de> for MotionDecay
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 Eq for MotionDecay
Source§impl PartialEq for MotionDecay
impl PartialEq for MotionDecay
Source§impl Serialize for MotionDecay
impl Serialize for MotionDecay
impl StructuralPartialEq for MotionDecay
Auto Trait Implementations§
impl Freeze for MotionDecay
impl RefUnwindSafe for MotionDecay
impl Send for MotionDecay
impl Sync for MotionDecay
impl Unpin for MotionDecay
impl UnsafeUnpin for MotionDecay
impl UnwindSafe for MotionDecay
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