pub struct Transitioning<T: StyleInterpolatable> { /* private fields */ }Expand description
A single property undergoing a timed transition.
Holds the prior value, the target value, and the timing window.
Call resolve each frame to get the interpolated
output.
Implementations§
Source§impl<T: StyleInterpolatable> Transitioning<T>
impl<T: StyleInterpolatable> Transitioning<T>
Sourcepub fn new(prior: T, target: T, now: f64, spec: &TransitionSpec) -> Self
pub fn new(prior: T, target: T, now: f64, spec: &TransitionSpec) -> Self
Create a new transition.
prior: the value before the change.target: the new value.now: current monotonic time (seconds).spec: transition timing.
Sourcepub fn is_active(&self, now: f64) -> bool
pub fn is_active(&self, now: f64) -> bool
Returns true when the transition is still in progress.
Sourcepub fn retarget(&mut self, new_target: T, now: f64, spec: &TransitionSpec)
pub fn retarget(&mut self, new_target: T, now: f64, spec: &TransitionSpec)
Update the target, restarting the transition from the current interpolated value.
Trait Implementations§
Source§impl<T: Clone + StyleInterpolatable> Clone for Transitioning<T>
impl<T: Clone + StyleInterpolatable> Clone for Transitioning<T>
Source§fn clone(&self) -> Transitioning<T>
fn clone(&self) -> Transitioning<T>
Returns a duplicate 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 moreAuto Trait Implementations§
impl<T> Freeze for Transitioning<T>where
T: Freeze,
impl<T> RefUnwindSafe for Transitioning<T>where
T: RefUnwindSafe,
impl<T> Send for Transitioning<T>where
T: Send,
impl<T> Sync for Transitioning<T>where
T: Sync,
impl<T> Unpin for Transitioning<T>where
T: Unpin,
impl<T> UnsafeUnpin for Transitioning<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Transitioning<T>where
T: 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