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<f32>
pub fn value_progress_factor(&self, name: &str) -> Option<f32>
Sourcepub fn value_progress_factor_or(&self, name: &str, default: f32) -> f32
pub fn value_progress_factor_or(&self, name: &str, default: f32) -> f32
Same as value_progress_factor
but returning default
instead of None
Sourcepub fn value_progress_factor_or_zero(&self, name: &str) -> f32
pub fn value_progress_factor_or_zero(&self, name: &str) -> f32
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<AnimatorState, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AnimatorState, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for AnimatorState
impl Serialize for AnimatorState
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. 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