Skip to main content

AnimationHandle

Struct AnimationHandle 

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

Handle returned by DesktopController::animate.

The handle is Clone-able and thread-safe: user code can hand copies to different threads (e.g. one thread waiting on completion, another polling progress or issuing stop).

Implementations§

Source§

impl AnimationHandle

Source

pub fn is_running(&self) -> bool

true while the animation is still ticking.

Source

pub fn progress(&self) -> f32

Global progress ∈ [0, 1] computed as the mean per-icon t.

Source

pub fn snapshot(&self) -> Vec<IconAnimationState>

Copy of the current per-icon state.

Source

pub fn missing_icons(&self) -> Vec<IconId>

Ids that were listed in the spec but were not present on the desktop at animation start. Populated once, before the first tick.

Source

pub fn finish_reason(&self) -> Option<FinishReason>

Read the finish reason if the animation has already ended.

Source

pub fn final_commit(&self) -> Option<FinalCommitOutcome>

Outcome of the Shell-side final commit, available once the animation has finished.

None means the commit outcome is unknown: the animation is still running, it took the overlay-unavailable fallback path, or finalize_overlay_session itself failed (in which case Self::finish_reason carries the error).

Read FinalCommitOutcome::moved_ids carefully — the Windows backend stops polling at the first confirmed icon, so a non-empty moved_ids means “the Shell confirmed the commit landed”, not “here is every icon that moved”. FinalCommitOutcome::missing_ids is the complete list of ids the backend could not resolve.

Source

pub fn stop(&self, mode: StopMode)

Ask the engine to stop the animation. Returns immediately; use Self::wait to await the actual finish.

This is the only way to alter a running animation. To change targets, curves or the icon set, stop, read Self::snapshot for the settled positions, and start a fresh animate.

Source

pub fn wait(&self) -> FinishReason

Block until the animation finishes and return the finish reason.

Source

pub fn wait_timeout(&self, timeout: StdDuration) -> Option<FinishReason>

Block for up to timeout waiting for the animation to finish. Returns None if the timeout elapsed while the animation was still running.

Source

pub fn on_start<F>(&self, cb: F)
where F: Fn(&StartContext) + Send + Sync + 'static,

Source

pub fn on_tick<F>(&self, cb: F)
where F: Fn(&TickContext) + Send + Sync + 'static,

Source

pub fn on_icon_complete<F>(&self, cb: F)
where F: Fn(&IconId) + Send + Sync + 'static,

Source

pub fn on_finish<F>(&self, cb: F)
where F: Fn(&FinishReason) + Send + Sync + 'static,

Trait Implementations§

Source§

impl Clone for AnimationHandle

Source§

fn clone(&self) -> AnimationHandle

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. 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.

§

impl<T> Instrument for T

§

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

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

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> 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.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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