pub struct AnimatorState { /* private fields */ }
Expand description
The state of a single animation in a component
This is most often accessed though AnimatorStates
in the WidgetContext
.
Implementations§
source§impl AnimatorState
impl AnimatorState
sourcepub fn in_progress(&self) -> bool
pub fn in_progress(&self) -> bool
Returns whether or not the animations is in-progress
sourcepub fn value_progress(&self, name: &str) -> Option<AnimatedValueProgress>
pub fn value_progress(&self, name: &str) -> Option<AnimatedValueProgress>
Get the current progress of the animation of a given value
This will return None
if the value is not currently being animated.
sourcepub fn value_progress_factor(&self, name: &str) -> Option<Scalar>
pub fn value_progress_factor(&self, name: &str) -> Option<Scalar>
sourcepub fn value_progress_factor_or(&self, name: &str, default: Scalar) -> Scalar
pub fn value_progress_factor_or(&self, name: &str, default: Scalar) -> Scalar
Same as value_progress_factor
but returning default
instead of None
sourcepub fn value_progress_factor_or_zero(&self, name: &str) -> Scalar
pub fn value_progress_factor_or_zero(&self, name: &str) -> Scalar
Same as value_progress_factor
but returning 0
instead of None
Trait Implementations§
source§impl Clone for AnimatorState
impl Clone for AnimatorState
source§fn clone(&self) -> AnimatorState
fn clone(&self) -> AnimatorState
Returns a copy 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 moresource§impl Debug for AnimatorState
impl Debug for AnimatorState
source§impl Default for AnimatorState
impl Default for AnimatorState
source§fn default() -> AnimatorState
fn default() -> AnimatorState
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for AnimatorState
impl<'de> Deserialize<'de> for AnimatorState
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AnimatorState
impl RefUnwindSafe for AnimatorState
impl Send for AnimatorState
impl Sync for AnimatorState
impl Unpin for AnimatorState
impl UnwindSafe for AnimatorState
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)