CompositionScopedBatch
struct · ferroui-base · v0.5.0
struct CompositionScopedBatch
An explicitly created group of active animations or effects (WinUI
CompositionScopedBatch).
Every key frame animation started while the batch is active (created and
neither suspended nor ended) belongs to it, also the animations of a
group and implicit animations. Once end has been called
and all its animations are over, the batch raises
completed on the thread of its compositor.
Several batches may be active at once; an animation belongs to each of them.
Members
compositor
fn compositor(self: &Self) -> &Rc<Compositor>
The associated compositor.
is_active
fn is_active(self: &Self) -> bool
Whether the batch is open for animations to be aggregated: false once it is suspended or ended.
is_ended
fn is_ended(self: &Self) -> bool
Whether the batch has been closed and can no longer accept changes.
end
fn end(self: &Self)
Closes the batch. Once closed it cannot be suspended or resumed
again. Completed is raised once all the animations of the batch are
over, right away (asynchronously) when there are none. Ending a batch
again does nothing.
suspend
fn suspend(self: &Self)
Suspends aggregating animations in the batch until
resume. Panics when the batch is ended (WinUI
throws).
resume
fn resume(self: &Self)
Resumes aggregating animations in the batch. Panics when the batch is ended (WinUI throws).
completed
fn completed(self: &Self, handler: impl Fn(&CompositionBatchCompletedEventArgs) -> () + 'static) -> Subscription
Raised once all animations of the ended batch have completed.
Dropping the returned guard removes the handler;
Subscription::detach keeps it for the life of the batch.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEitherAsCompositionObject
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.