Struct tween::Oscillator
source · #[repr(transparent)]pub struct Oscillator<T: ?Sized>(pub T);
Expand description
An Oscillator is a wrapper around a Tween which places the Tween into an infinite ping pong.
This is similar to a Looper, but instead of restarting the tween at the beginning, it restarts it at the end and travels backwards. For many Tweens in this library, this is the same
Tuple Fields§
§0: T
Implementations§
Trait Implementations§
source§impl<T: Clone + ?Sized> Clone for Oscillator<T>
impl<T: Clone + ?Sized> Clone for Oscillator<T>
source§fn clone(&self) -> Oscillator<T>
fn clone(&self) -> Oscillator<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 Oscillator<T>
impl<T: PartialEq + ?Sized> PartialEq for Oscillator<T>
source§fn eq(&self, other: &Oscillator<T>) -> bool
fn eq(&self, other: &Oscillator<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T: PartialOrd + ?Sized> PartialOrd for Oscillator<T>
impl<T: PartialOrd + ?Sized> PartialOrd for Oscillator<T>
source§fn partial_cmp(&self, other: &Oscillator<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &Oscillator<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 Oscillator<T>where
Value: TweenValue,
T: Tween<Value>,
impl<Value, T> Tween<Value> for Oscillator<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 Oscillator<T>
impl<T: Eq + ?Sized> Eq for Oscillator<T>
impl<T: ?Sized> StructuralPartialEq for Oscillator<T>
Auto Trait Implementations§
impl<T> Freeze for Oscillator<T>
impl<T> RefUnwindSafe for Oscillator<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Send for Oscillator<T>
impl<T> Sync for Oscillator<T>
impl<T> Unpin for Oscillator<T>
impl<T> UnwindSafe for Oscillator<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