AnimationSequence

Struct AnimationSequence 

Source
pub struct AnimationSequence<T: Animatable> { /* private fields */ }
Expand description

Optimized animation sequence that uses shared immutable data and atomic counters to avoid cloning sequences on step transitions

Implementations§

Source§

impl<T: Animatable> AnimationSequence<T>

Source

pub fn new() -> Self

Creates a new empty animation sequence

Source

pub fn with_capacity(_capacity: u8) -> Self

Creates a new animation sequence with specified capacity hint Note: This is kept for API compatibility but doesn’t pre-allocate since we use Arc<[T]>

Source

pub fn from_steps(steps: Vec<AnimationStep<T>>) -> Self

Creates a new animation sequence from a vector of steps

Source

pub fn with_on_complete<F>(steps: Vec<AnimationStep<T>>, on_complete: F) -> Self
where F: FnOnce() + Send + 'static,

Creates a new animation sequence with a completion callback

Source

pub fn reserve(&mut self, _additional: u8)

Reserve additional capacity (kept for API compatibility, but no-op since we use Arc<[T]>)

Source

pub fn then(self, target: T, config: AnimationConfig) -> Self

Adds a new step to the sequence and returns a new sequence This creates a new Arc with all steps to maintain immutability

Source

pub fn on_complete<F: FnOnce() + Send + 'static>(self, f: F) -> Self

Sets a completion callback

Source

pub fn advance_step(&self) -> bool

Advances to the next step in the sequence Returns true if advanced, false if already at the end

Source

pub fn current_step_index(&self) -> u8

Gets the current step index

Source

pub fn current_step(&self) -> u8

Gets the current step index (kept for backward compatibility)

Source

pub fn current_config(&self) -> Option<&AnimationConfig>

Gets the configuration for the current step

Source

pub fn current_target(&self) -> Option<T>

Gets the target value for the current step

Source

pub fn current_step_data(&self) -> Option<&AnimationStep<T>>

Gets the current step data

Source

pub fn steps(&self) -> &[AnimationStep<T>]

Gets all steps (for backward compatibility)

Source

pub fn is_complete(&self) -> bool

Checks if the sequence is complete (at the last step)

Source

pub fn total_steps(&self) -> usize

Gets the total number of steps

Source

pub fn reset(&self)

Resets the sequence to the first step

Source

pub fn execute_completion(&self)

Executes the completion callback if present This method is thread-safe and can be called without ownership

Trait Implementations§

Source§

impl<T: Animatable> Clone for AnimationSequence<T>

Source§

fn clone(&self) -> Self

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<T: Animatable> Default for AnimationSequence<T>

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<T> !Freeze for AnimationSequence<T>

§

impl<T> RefUnwindSafe for AnimationSequence<T>
where T: RefUnwindSafe,

§

impl<T> Send for AnimationSequence<T>
where T: Sync + Send,

§

impl<T> Sync for AnimationSequence<T>
where T: Sync + Send,

§

impl<T> Unpin for AnimationSequence<T>

§

impl<T> UnwindSafe for AnimationSequence<T>
where T: RefUnwindSafe,

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> InitializeFromFunction<T> for T

Source§

fn initialize_from_function(f: fn() -> T) -> T

Create an instance of this type from an initialization function
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<Ret> SpawnIfAsync<(), Ret> for Ret

Source§

fn spawn(self) -> Ret

Spawn the value into the dioxus runtime if it is an async block
Source§

impl<T, O> SuperFrom<T> for O
where O: From<T>,

Source§

fn super_from(input: T) -> O

Convert from a type to another type.
Source§

impl<T, O, M> SuperInto<O, M> for T
where O: SuperFrom<T, M>,

Source§

fn super_into(self) -> O

Convert from a type to another type.
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T