pub struct PreObservers { /* private fields */ }Expand description
Bundle of observers to attach atomically to a new animation.
AnimationHandle::on_* can only be called after the
handle is returned, which races against the worker’s first tick — a
completion that fires before your on_icon_complete callback is
registered will simply be lost. Passing observers through this bundle
via DesktopController::animate_with_observers
installs them before the worker enters its tick loop.
let obs = PreObservers::new()
.on_tick(|ctx| println!("tick #{}", ctx.finalized_icons))
.on_finish(|reason| println!("finished: {reason:?}"));Implementations§
Trait Implementations§
Source§impl Clone for PreObservers
impl Clone for PreObservers
Source§fn clone(&self) -> PreObservers
fn clone(&self) -> PreObservers
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for PreObservers
impl Default for PreObservers
Source§fn default() -> PreObservers
fn default() -> PreObservers
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for PreObservers
impl !UnwindSafe for PreObservers
impl Freeze for PreObservers
impl Send for PreObservers
impl Sync for PreObservers
impl Unpin for PreObservers
impl UnsafeUnpin for PreObservers
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