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