pub struct ValueTween<T> {
pub begin: T,
pub end: T,
}Expand description
Dart’s Tween<T> held as a value rather than an arena object: for a tween whose ends
are fixed once it is made, as a Dart static final or const tween’s are, or one a build
makes and drops.
A driven animation holds a copy, so nothing frees it and nothing can change its ends; a
tween whose begin or end is written after it is driven is a Tween
(patterns/value-tweens.md in the porting skill).
Fields§
§begin: TThe value this variable has at the beginning of the animation.
end: TThe value this variable has at the end of the animation.
Implementations§
Source§impl<T> ValueTween<T>
impl<T> ValueTween<T>
Sourcepub const fn new(begin: T, end: T) -> ValueTween<T>
pub const fn new(begin: T, end: T) -> ValueTween<T>
Creates a tween from begin to end.
Trait Implementations§
Source§impl<T> Animatable<T> for ValueTween<T>where
T: TweenLerp,
impl<T> Animatable<T> for ValueTween<T>where
T: TweenLerp,
Source§fn transform(&self, _app: &App, t: f64) -> T
fn transform(&self, _app: &App, t: f64) -> T
Returns the value of the object at point
t. Read moreSource§fn evaluate(&self, app: &App, animation: AnyAnimation<f64>) -> Twhere
Self: Sized,
fn evaluate(&self, app: &App, animation: AnyAnimation<f64>) -> Twhere
Self: Sized,
The current value of this object for the given animation. Read more
Source§fn animate(
self,
app: &mut App,
parent: Retained<AnyAnimation<f64>>,
) -> Retained<AnyAnimation<T>>
fn animate( self, app: &mut App, parent: Retained<AnyAnimation<f64>>, ) -> Retained<AnyAnimation<T>>
Returns a new animation that is driven by the given animation but
that takes on values determined by this object. The new animation keeps
parent; whoever keeps the result keeps both.Source§fn chain<P>(self, parent: P) -> ChainedEvaluation<P, Self>
fn chain<P>(self, parent: P) -> ChainedEvaluation<P, Self>
Returns a new
Animatable whose value is determined by first
evaluating the given parent and then evaluating this object at the
result.Source§impl<T> Clone for ValueTween<T>where
T: Clone,
impl<T> Clone for ValueTween<T>where
T: Clone,
Source§fn clone(&self) -> ValueTween<T>
fn clone(&self) -> ValueTween<T>
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<T> Copy for ValueTween<T>where
T: Copy,
Auto Trait Implementations§
impl<T> Forget for ValueTween<T>
impl<T> Freeze for ValueTween<T>where
T: Freeze,
impl<T> Move for ValueTween<T>
impl<T> RefUnwindSafe for ValueTween<T>where
T: RefUnwindSafe,
impl<T> Send for ValueTween<T>where
T: Send,
impl<T> Sync for ValueTween<T>where
T: Sync,
impl<T> Unpin for ValueTween<T>where
T: Unpin,
impl<T> UnsafeUnpin for ValueTween<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ValueTween<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