Skip to main content

TransitionManager

Struct TransitionManager 

Source
pub struct TransitionManager { /* private fields */ }
Expand description

Transition manager for handling multiple active transitions

Implementations§

Source§

impl TransitionManager

Source

pub fn new() -> Self

Create a new transition manager

Source

pub fn start( &mut self, property: impl Into<String>, from: f32, to: f32, transition: &Transition, )

Start a transition for a property

If reduced motion is preferred, the transition completes instantly (no animation, just jumps to final value).

Source

pub fn update(&mut self, delta: Duration)

Update all transitions

Source

pub fn get(&self, property: &str) -> Option<f32>

Get current value for a property

Source

pub fn has_active(&self) -> bool

Check if there are active transitions

Source

pub fn active_properties(&self) -> impl Iterator<Item = &str>

Get all active transition property names

Source

pub fn clear(&mut self)

Clear all transitions

Source

pub fn current_values(&self) -> HashMap<String, f32>

Get all current transition values as a map

Returns a HashMap that can be passed to RenderContext for widgets to access animated property values during rendering.

Source

pub fn start_for_node( &mut self, element_id: impl Into<String>, property: impl Into<String>, from: f32, to: f32, transition: &Transition, )

Start a transition for a specific element

Associates the transition with an element ID for partial rendering. If reduced motion is preferred, no transition is added.

Source

pub fn update_nodes(&mut self, delta: Duration)

Update all node-aware transitions

Source

pub fn get_for_node(&self, element_id: &str, property: &str) -> Option<f32>

Get current value for a property on a specific node

Source

pub fn active_node_ids(&self) -> impl Iterator<Item = &str>

Get all element IDs with active transitions

Used for partial rendering - only these nodes need to be redrawn.

Source

pub fn node_has_active(&self, element_id: &str) -> bool

Check if a specific node has active transitions

Source

pub fn current_values_for_node(&self, element_id: &str) -> HashMap<String, f32>

Get all current transition values for a specific node

Trait Implementations§

Source§

impl Clone for TransitionManager

Source§

fn clone(&self) -> TransitionManager

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TransitionManager

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TransitionManager

Source§

fn default() -> TransitionManager

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.