Struct tween::Extrapolator
source · #[repr(transparent)]pub struct Extrapolator<T: ?Sized>(pub T);
Expand description
An Extrapolator is a wrapper around a Tween, which allows a tween to go beyond the range of
0.0
to 1.0
. Note that for Looper, Oscillator, or any Tween whose Tween::is_finite
returns false, wrapping in an Extrapolator is unnecssary, as they are already infinite tween.
As a note of caution, some Tweens, like Linear handle extrapolation just fine, but many others, like SineIn will give unhelpful results. They are clamped for a reason!
Tuple Fields§
§0: T
Implementations§
Trait Implementations§
source§impl<T: Clone + ?Sized> Clone for Extrapolator<T>
impl<T: Clone + ?Sized> Clone for Extrapolator<T>
source§fn clone(&self) -> Extrapolator<T>
fn clone(&self) -> Extrapolator<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: PartialEq + ?Sized> PartialEq for Extrapolator<T>
impl<T: PartialEq + ?Sized> PartialEq for Extrapolator<T>
source§fn eq(&self, other: &Extrapolator<T>) -> bool
fn eq(&self, other: &Extrapolator<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T: PartialOrd + ?Sized> PartialOrd for Extrapolator<T>
impl<T: PartialOrd + ?Sized> PartialOrd for Extrapolator<T>
source§fn partial_cmp(&self, other: &Extrapolator<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &Extrapolator<T>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<Value, T> Tween<Value> for Extrapolator<T>where
Value: TweenValue,
T: Tween<Value>,
impl<Value, T> Tween<Value> for Extrapolator<T>where
Value: TweenValue,
T: Tween<Value>,
source§fn tween(&mut self, value_delta: Value, percent: f32) -> Value
fn tween(&mut self, value_delta: Value, percent: f32) -> Value
Returns a new value based on the value_delta and the percent. Read more
source§fn is_finite(&self) -> bool
fn is_finite(&self) -> bool
All Tweens in this library use this default method, except Looper and Oscillator, which
which are both unbounded (because they never stop returning values), and Extrapolator,
which simply unbounds tweens. Read more
impl<T: Copy + ?Sized> Copy for Extrapolator<T>
impl<T: Eq + ?Sized> Eq for Extrapolator<T>
impl<T: ?Sized> StructuralPartialEq for Extrapolator<T>
Auto Trait Implementations§
impl<T> Freeze for Extrapolator<T>
impl<T> RefUnwindSafe for Extrapolator<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Send for Extrapolator<T>
impl<T> Sync for Extrapolator<T>
impl<T> Unpin for Extrapolator<T>
impl<T> UnwindSafe for Extrapolator<T>where
T: UnwindSafe + ?Sized,
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