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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.