pub struct Animated<T: Lerp + 'static> { /* private fields */ }Expand description
A signal-backed value that chases a target over time under a Curve, driven by the central ticker.
Implementations§
Source§impl<T: Lerp + 'static> Animated<T>
impl<T: Lerp + 'static> Animated<T>
Sourcepub fn new(initial: T, curve: impl Into<Curve>) -> Self
pub fn new(initial: T, curve: impl Into<Curve>) -> Self
Create an animation resting at initial. It registers with the ticker only once retargeted away from its current goal.
Sourcepub fn retarget(&self, target: T)
pub fn retarget(&self, target: T)
Aim at a new target. Springs keep position and velocity (interruptible); tweens restart from the current value over the full duration. Retargeting to the current goal is a no-op.
Sourcepub fn read(&self) -> ReadSignal<T>
pub fn read(&self) -> ReadSignal<T>
A read-only handle to the underlying signal.
Sourcepub fn is_settled(&self) -> bool
pub fn is_settled(&self) -> bool
Whether the animation has reached its target and deregistered.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Animated<T>
impl<T> !Send for Animated<T>
impl<T> !Sync for Animated<T>
impl<T> !UnwindSafe for Animated<T>
impl<T> Freeze for Animated<T>
impl<T> Unpin for Animated<T>
impl<T> UnsafeUnpin for Animated<T>
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