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
impl AnimationHandle
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
true while the animation is still ticking.
Sourcepub fn snapshot(&self) -> Vec<IconAnimationState>
pub fn snapshot(&self) -> Vec<IconAnimationState>
Copy of the current per-icon state.
Sourcepub fn missing_icons(&self) -> Vec<IconId>
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.
Sourcepub fn finish_reason(&self) -> Option<FinishReason>
pub fn finish_reason(&self) -> Option<FinishReason>
Read the finish reason if the animation has already ended.
Sourcepub fn final_commit(&self) -> Option<FinalCommitOutcome>
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.
Sourcepub fn stop(&self, mode: StopMode)
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.
Sourcepub fn wait(&self) -> FinishReason
pub fn wait(&self) -> FinishReason
Block until the animation finishes and return the finish reason.
Sourcepub fn wait_timeout(&self, timeout: StdDuration) -> Option<FinishReason>
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.
pub fn on_start<F>(&self, cb: F)
pub fn on_tick<F>(&self, cb: F)
pub fn on_icon_complete<F>(&self, cb: F)
pub fn on_finish<F>(&self, cb: F)
Trait Implementations§
Source§impl Clone for AnimationHandle
impl Clone for AnimationHandle
Source§fn clone(&self) -> AnimationHandle
fn clone(&self) -> AnimationHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more