pub struct Tween<T> {
pub begin: T,
pub end: T,
}Expand description
The shared animation layer — physics, curves, driver — see
frus_core::animation. Re-exported here so applications can reach it through
frus_widgets without depending on frus-core directly.
Interpolates a value between two bounds, driven by a [0,1] progress value.
A single [0,1] driver — a controller, a spring — can therefore animate any
number of typed values, each with its own bounds.
Fields§
§begin: TThe value at t = 0.
end: TThe value at t = 1.
Implementations§
Trait Implementations§
Source§impl<T> Animatable for Tween<T>where
T: Lerp,
impl<T> Animatable for Tween<T>where
T: Lerp,
Source§fn curved(self, curve: Curve) -> Curved<Self>where
Self: Sized,
fn curved(self, curve: Curve) -> Curved<Self>where
Self: Sized,
Chains a
Curve before evaluation: t is shaped by the curve first,
so a single linear progress value can drive a value with non-linear timing.Source§fn animate<'a>(
&'a self,
controller: &'a AnimationController,
) -> Animation<'a, Self>where
Self: Sized,
fn animate<'a>(
&'a self,
controller: &'a AnimationController,
) -> Animation<'a, Self>where
Self: Sized,
Binds this animation to an
AnimationController’s progress, producing an
Animation whose value() follows the controller’s current value. The
controller’s value is normalised by its own bounds, so a non-unit
controller still drives a full [0,1].impl<T> Copy for Tween<T>where
T: Copy,
impl<T> StructuralPartialEq for Tween<T>where
T: PartialEq,
Auto Trait Implementations§
impl<T> Freeze for Tween<T>where
T: Freeze,
impl<T> RefUnwindSafe for Tween<T>where
T: RefUnwindSafe,
impl<T> Send for Tween<T>where
T: Send,
impl<T> Sync for Tween<T>where
T: Sync,
impl<T> Unpin for Tween<T>where
T: Unpin,
impl<T> UnsafeUnpin for Tween<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Tween<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