pub enum DecayType {
Linear {
rate: f64,
},
Exponential {
lambda: f64,
},
HalfLife {
half_life_secs: i64,
},
Step {
drop_amount: f64,
interval_secs: i64,
},
Custom {
points: Vec<(i64, f64)>,
},
}Expand description
Type of decay function.
Variants§
Linear
Linear decay: value = initial - (rate * time).
Exponential
Exponential decay: value = initial * e^(-λt).
HalfLife
Half-life decay: value = initial * (0.5)^(t/half_life).
Step
Step decay: drops at specific intervals.
Fields
Custom
Custom decay curve.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DecayType
impl<'de> Deserialize<'de> for DecayType
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
Auto Trait Implementations§
impl Freeze for DecayType
impl RefUnwindSafe for DecayType
impl Send for DecayType
impl Sync for DecayType
impl Unpin for DecayType
impl UnsafeUnpin for DecayType
impl UnwindSafe for DecayType
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